mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-26 03:44:58 +08:00
'个人微信中主动发送图片的修改,但是只能发送链接'
This commit is contained in:
@@ -43,7 +43,9 @@ class GewechatMessageConverter(adapter.MessageConverter):
|
|||||||
elif isinstance(component, platform_message.Plain):
|
elif isinstance(component, platform_message.Plain):
|
||||||
content_list.append({"type": "text", "content": component.text})
|
content_list.append({"type": "text", "content": component.text})
|
||||||
elif isinstance(component, platform_message.Image):
|
elif isinstance(component, platform_message.Image):
|
||||||
pass
|
if not component.url:
|
||||||
|
pass
|
||||||
|
content_list.append({"type": "image", "image": component.url})
|
||||||
|
|
||||||
|
|
||||||
elif isinstance(component, platform_message.Voice):
|
elif isinstance(component, platform_message.Voice):
|
||||||
@@ -254,6 +256,10 @@ class GeWeChatAdapter(adapter.MessagePlatformAdapter):
|
|||||||
if msg['type'] == 'text':
|
if msg['type'] == 'text':
|
||||||
await self.bot.post_text(app_id=self.config['app_id'], to_wxid=target_id, content=msg['content'])
|
await self.bot.post_text(app_id=self.config['app_id'], to_wxid=target_id, content=msg['content'])
|
||||||
|
|
||||||
|
elif msg['type'] == 'image':
|
||||||
|
|
||||||
|
await self.bot.post_image(app_id=self.config['app_id'], to_wxid=target_id, img_url=msg["image"])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async def reply_message(
|
async def reply_message(
|
||||||
|
|||||||
Reference in New Issue
Block a user