mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
新增发送emoji表情?(好像没啥用)和发送链接功能
This commit is contained in:
@@ -48,10 +48,17 @@ class GewechatMessageConverter(adapter.MessageConverter):
|
||||
pass
|
||||
content_list.append({"type": "image", "image": component.url})
|
||||
elif isinstance(component, platform_message.MiniPrograms):
|
||||
# content_list.append({"type": 'MiniPrograms', 'xml_data': component.xml_data, 'image_url': component.image_url})
|
||||
content_list.append({"type": 'MiniPrograms', 'mini_app_id': component.mini_app_id, 'display_name': component.display_name,
|
||||
'page_path': component.page_path, 'cover_img_url': component.image_url, 'title': component.title,
|
||||
'user_name': component.user_name})
|
||||
elif isinstance(component, platform_message.ForwardMiniPrograms):
|
||||
content_list.append({"type": 'ForwardMiniPrograms', 'xml_data': component.xml_data, 'image_url': component.image_url})
|
||||
elif isinstance(component, platform_message.EmoJi):
|
||||
content_list.append({'type': 'emoji', 'emoji_md5': component.emoji_md5, 'emoji_size': component.emoji_size})
|
||||
elif isinstance(component, platform_message.Link):
|
||||
content_list.append({'type': 'Link', 'link_title': component.link_title, 'link_desc': component.link_desc,
|
||||
'link_thumb_url': component.link_thumb_url, 'link_url': component.link_url})
|
||||
|
||||
|
||||
elif isinstance(component, platform_message.Voice):
|
||||
content_list.append({"type": "voice", "url": component.url, "length": component.length})
|
||||
@@ -369,6 +376,15 @@ class GeWeChatAdapter(adapter.MessagePlatformAdapter):
|
||||
self.bot.post_mini_app(app_id=self.config['app_id'], to_wxid=target_id, mini_app_id=msg['mini_app_id']
|
||||
, display_name=msg['display_name'], page_path=msg['page_path']
|
||||
, cover_img_url=msg['cover_img_url'], title=msg['title'], user_name=msg['user_name'])
|
||||
elif msg['type'] == 'ForwardMiniPrograms':
|
||||
self.bot.forward_mini_app(app_id=self.config['app_id'], to_wxid=target_id, xml=msg['xml_data'], cover_img_url=msg['inage_url'])
|
||||
elif msg['type'] == 'emoji':
|
||||
self.bot.post_emoji(app_id=self.config['app_id'], to_wxid=target_id,
|
||||
emoji_md5=msg['emoji_md5'], emoji_size=msg['emoji_size'])
|
||||
elif msg['type'] == 'Link':
|
||||
self.bot.post_link(app_id=self.config['app_id'], to_wxid=target_id
|
||||
,title=msg['link_title'], desc=msg['link_desc']
|
||||
, link_url=msg['link_url'], thumb_url=msg['link_thumb_url'])
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -672,6 +672,29 @@ class ForwardMiniPrograms(MessageComponent):
|
||||
image_url: typing.Optional[str] = None
|
||||
|
||||
|
||||
class EmoJi(MessageComponent):
|
||||
"""emoji表情"""
|
||||
type: str = 'EmoJi'
|
||||
"""emojimd5"""
|
||||
emoji_md5: str
|
||||
"""emoji大小"""
|
||||
emoji_size: int
|
||||
|
||||
|
||||
class Link(MessageComponent):
|
||||
"""发送链接"""
|
||||
type: str = 'Link'
|
||||
"""标题"""
|
||||
link_title: str = ''
|
||||
"""链接描述"""
|
||||
link_desc: str = ''
|
||||
"""链接地址"""
|
||||
link_url: str = ''
|
||||
"""链接略缩图"""
|
||||
link_thumb_url: str = ''
|
||||
|
||||
|
||||
|
||||
class Voice(MessageComponent):
|
||||
"""语音。"""
|
||||
type: str = "Voice"
|
||||
|
||||
Reference in New Issue
Block a user