调整入库内容,新群内容
This commit is contained in:
@@ -504,7 +504,7 @@ class ContactsDBOperator(BaseDBOperator):
|
||||
|
||||
data = {
|
||||
'chatroom_id': get_str('UserName'),
|
||||
'nick_name': get_str('NickName'),
|
||||
'nick_name': get_str('NickName',"未知群名"),
|
||||
'py_initial': get_str('Pyinitial'),
|
||||
'quan_pin': get_str('QuanPin'),
|
||||
'sex': chatroom_data.get('Sex', 0),
|
||||
|
||||
5
robot.py
5
robot.py
@@ -167,7 +167,7 @@ class Robot:
|
||||
self.ipad_bot.nickname = profile.get("NickName").get("string")
|
||||
self.ipad_bot.alias = profile.get("Alias")
|
||||
self.ipad_bot.phone = profile.get("BindMobile").get("string")
|
||||
self.ipad_bot.signature = profile.get("Signature")
|
||||
self.ipad_bot.signature = profile.get("Signature", "")
|
||||
# 更新Robot类的属性
|
||||
self.wxid = self.ipad_bot.wxid
|
||||
self.nickname = self.ipad_bot.nickname
|
||||
@@ -316,7 +316,7 @@ class Robot:
|
||||
self.ipad_bot.nickname = data.get("acctSectResp").get("nickName")
|
||||
self.ipad_bot.alias = data.get("acctSectResp").get("alias")
|
||||
self.ipad_bot.phone = data.get("acctSectResp").get("bindMobile")
|
||||
self.ipad_bot.signature = data.get("Signature")
|
||||
self.ipad_bot.signature = data.get("Signature", "")
|
||||
|
||||
# 更新Robot类的属性
|
||||
self.wxid = self.ipad_bot.wxid
|
||||
@@ -393,6 +393,7 @@ class Robot:
|
||||
try:
|
||||
chatroom_info = await self.ipad_bot.get_chatroom_info(group_id)
|
||||
self.LOG.debug(f"获取到群信息: {chatroom_info}")
|
||||
self.allContacts[group_id] = chatroom_info.get('NickName', "未知群名")
|
||||
if chatroom_info:
|
||||
# 保存群信息到数据库
|
||||
self.contacts_db.save_chatroom_info(chatroom_info)
|
||||
|
||||
Reference in New Issue
Block a user