入群通知,使用富文本内容

This commit is contained in:
liuwei
2025-04-07 09:44:01 +08:00
parent 2dc2631f76
commit 28117e48cd
3 changed files with 37 additions and 5 deletions

View File

@@ -208,12 +208,15 @@ class GroupMemberChangePlugin(MessagePluginInterface):
"""发送成员入群通知"""
now_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
message = f"""【入群欢迎】
message = f"""
欢迎新成员: {nickname}
入群时间: {now_time}
⌚️: {now_time}
"""
# 使用message_util发送消息
self.message_util.send_text_msg(message, group_id)
# 使用message_util发送消息 编写一个 send_rich_text 方法
self.message_util.send_rich_text("bot", "gh_bot", f"欢迎 {nickname} 加入群聊", message,
"https://hot.imsyy.top/#/",
"https://github.com/bovine-liu/liu_icon/blob/main/icon/a-bot.jpg",
group_id)
self.LOG.info(f"已发送入群通知: {nickname} 加入群 {group_id}")
@property