加入头像显示功能
This commit is contained in:
7
robot.py
7
robot.py
@@ -58,7 +58,7 @@ class Robot(Job):
|
||||
self.contact_manager = ContactManager.get_instance()
|
||||
self.allContacts = self.get_all_contacts()
|
||||
self.all_head_img = self.get_all_head_img_url()
|
||||
self.contact_manager.set_contacts(self.allContacts, self.wcf)
|
||||
self.contact_manager.set_contacts(self.allContacts, self.all_head_img, self.wcf)
|
||||
|
||||
self.LOG.info(f"DB+REDIS 连接池开始初始化")
|
||||
# 使用单例模式获取实例
|
||||
@@ -341,7 +341,7 @@ class Robot(Job):
|
||||
def get_all_head_img_url(self) -> dict:
|
||||
try:
|
||||
head_img_urls = self.wcf.query_sql("MicroMsg.db", "SELECT usrName ,bigHeadImgUrl FROM ContactHeadImgUrl;")
|
||||
self.LOG.info(f"head_img_urls: {head_img_urls}")
|
||||
# self.LOG.info(f"head_img_urls: {head_img_urls}")
|
||||
return {contact["usrName"]: contact["bigHeadImgUrl"] for contact in head_img_urls}
|
||||
except Exception as e:
|
||||
self.LOG.error(f"get_all_head_img_url error: {e}")
|
||||
@@ -536,5 +536,6 @@ class Robot(Job):
|
||||
def refresh_contacts(self):
|
||||
"""刷新联系人信息"""
|
||||
self.allContacts = self.get_all_contacts()
|
||||
self.contact_manager.refresh_contacts(self.allContacts, self.wcf)
|
||||
self.all_head_img = self.get_all_head_img_url()
|
||||
self.contact_manager.refresh_contacts(self.allContacts,self.all_head_img, self.wcf)
|
||||
self.LOG.info("联系人信息已刷新")
|
||||
|
||||
Reference in New Issue
Block a user