优化消息XML内容,提取到静态文件里面。
This commit is contained in:
@@ -10,6 +10,7 @@ from db.contacts_db import ContactsDBOperator
|
||||
from utils.robot_cmd.robot_command import Feature, PermissionStatus, GroupBotManager
|
||||
from utils.wechat.contact_manager import ContactManager
|
||||
from wechat_ipad import WechatAPIClient
|
||||
from wechat_ipad.models.appmsg_xml import LINK_XML
|
||||
|
||||
|
||||
class GroupMemberChangePlugin(MessagePluginInterface):
|
||||
@@ -134,53 +135,8 @@ class GroupMemberChangePlugin(MessagePluginInterface):
|
||||
contact_db.save_chatroom_member_simple(roomid, member_details)
|
||||
except Exception as e:
|
||||
self.LOG.warning(f"新增群员信息失败: {e}")
|
||||
xml_content = f"""
|
||||
<appmsg appid="" sdkver="1">
|
||||
<title>👏欢迎 {nickname} 加入群聊!🎉</title>
|
||||
<des>⌚时间:{now}</des>
|
||||
<action>view</action>
|
||||
<type>5</type>
|
||||
<showtype>0</showtype>
|
||||
<content />
|
||||
<url>https://hot.imsyy.top/#/</url>
|
||||
<dataurl />
|
||||
<lowurl />
|
||||
<lowdataurl />
|
||||
<recorditem />
|
||||
<thumburl>{head_url}</thumburl>
|
||||
<messageaction />
|
||||
<laninfo />
|
||||
<extinfo />
|
||||
<sourceusername />
|
||||
<sourcedisplayname />
|
||||
<commenturl />
|
||||
<appattach>
|
||||
<totallen>0</totallen>
|
||||
<attachid />
|
||||
<emoticonmd5 />
|
||||
<fileext />
|
||||
<aeskey />
|
||||
</appattach>
|
||||
<webviewshared>
|
||||
<publisherId />
|
||||
<publisherReqId>0</publisherReqId>
|
||||
</webviewshared>
|
||||
<weappinfo>
|
||||
<pagepath />
|
||||
<username />
|
||||
<appid />
|
||||
<appservicetype>0</appservicetype>
|
||||
</weappinfo>
|
||||
<websearch />
|
||||
</appmsg>
|
||||
<fromusername>Jyunere</fromusername>
|
||||
<scene>0</scene>
|
||||
<appinfo>
|
||||
<version>1</version>
|
||||
<appname></appname>
|
||||
</appinfo>
|
||||
<commenturl></commenturl>
|
||||
"""
|
||||
xml_content = f"{LINK_XML}".format(nickname=nickname, now=now, head_url=head_url)
|
||||
|
||||
await bot.send_link_xml_message(xml_content, roomid)
|
||||
return True, "已发送进群欢迎语"
|
||||
return False, "无需执行"
|
||||
|
||||
Reference in New Issue
Block a user