debug
This commit is contained in:
16
robot.py
16
robot.py
@@ -131,17 +131,15 @@ class Robot(Job):
|
||||
def toChitchat(self, msg: WxMsg) -> bool:
|
||||
"""闲聊,接入 ChatGPT
|
||||
"""
|
||||
# 去除@的人和空格等字符
|
||||
q = re.sub(r"@.*?[\u2005|\s]", "", msg.content).replace(" ", "")
|
||||
|
||||
# 所有人员都可以要求他撤回刚刚的信息
|
||||
if msg.from_group():
|
||||
if q == '撤回':
|
||||
self.revoke_messages(msg.roomid)
|
||||
return True
|
||||
if not self.chat: # 没接 ChatGPT,固定回复
|
||||
rsp = "你@我干嘛?"
|
||||
else: # 接了 ChatGPT,智能回复
|
||||
# 去除@的人和空格等字符
|
||||
q = re.sub(r"@.*?[\u2005|\s]", "", msg.content).replace(" ", "")
|
||||
# 所有人员都可以要求他撤回刚刚的信息
|
||||
if q == '撤回':
|
||||
self.revoke_messages(msg.roomid)
|
||||
return True
|
||||
if q == "今日百度新闻":
|
||||
self.newsBaiduReport((msg.roomid if msg.from_group() else msg.sender))
|
||||
return True
|
||||
@@ -193,7 +191,7 @@ class Robot(Job):
|
||||
# 记录在群里发的最新消息,可以通过撤回指令撤回
|
||||
if msg.from_self():
|
||||
self.revoke_receive_message(msg)
|
||||
rsp = GroupBotManager.handle_command(msg.roomid, msg.content)
|
||||
rsp = self.gbm.handle_command(msg.roomid, msg.content)
|
||||
self.sendTextMsg(rsp, msg.roomid, msg.sender)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user