加群消息测试

This commit is contained in:
liuwei
2025-03-10 15:01:20 +08:00
parent cc12256068
commit 037b712340

View File

@@ -31,60 +31,8 @@ class GroupAdd:
now_time = str(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
nick_name = self.all_contacts.get(message.sender, message.sender)
user_info = self.wcf.query_sql("MicroMsg.db", f"SELECT * FROM Contact WHERE UserName = '{message.sender}';")
# 创建包含用户昵称、时间和Emoji表情的字符串
welcome_message = f"🎉 欢迎用户 {nick_name} \n👋 在 {now_time} 🕒 加入群聊!😊"
self.LOG.info(f"GroupAdd contact:{user_info}")
BigHeadImgUrl = ""
url = "https://hot.imsyy.top/#/"
outxml = f"""
<?xml version="1.0"?>
<msg>
<appmsg appid="" sdkver="1">
<title>👏欢迎 {nick_name} 加入群聊!🎉</title>
<des>⌚时间:{now_time}</des>
<action>view</action>
<type>5</type>
<showtype>0</showtype>
<content />
<url>{url}</url>
<dataurl />
<lowurl />
<lowdataurl />
<recorditem />
<thumburl>{BigHeadImgUrl}</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>
</msg>
"""
self.wcf.send_text(welcome_message, (message.roomid if message.from_group() else message.sender),
message.sender)