From 22ddef0f5a1f8c1839db993c8436b38e6d154af1 Mon Sep 17 00:00:00 2001 From: mzivv <984084954@qq.com> Date: Mon, 7 Nov 2022 19:00:06 +0800 Subject: [PATCH] add some notes Signed-off-by: mzivv <984084954@qq.com> --- robot.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/robot.py b/robot.py index 30738bf..0edf802 100644 --- a/robot.py +++ b/robot.py @@ -130,8 +130,8 @@ class Robot(Job): ats = f" @{self.allContacts.get(wxid, '')}" - self.LOG.info(f"To {receiver}: {msg}{ats}") # {msg}{ats} 表示要发送的消息内容后面紧跟@,例如 北京天气情况为:xxx @张三,微信规定需这样写,否则@不生效 + self.LOG.info(f"To {receiver}: {msg}{ats}") self.wcf.send_text(f"{msg}{ats}", receiver, at_list) def getAllContacts(self): @@ -139,10 +139,8 @@ class Robot(Job): 获取联系人(包括好友、公众号、服务号、群成员……) 格式: {"wxid": "NickName"} """ - contacts = self.wcf.query_sql( - "MicroMsg.db", "SELECT UserName, NickName FROM Contact;") - return {contact["UserName"]: contact["NickName"] - for contact in contacts} + contacts = self.wcf.query_sql("MicroMsg.db", "SELECT UserName, NickName FROM Contact;") + return {contact["UserName"]: contact["NickName"]for contact in contacts} def keepRunningAndBlockProcess(self) -> None: """