debug
This commit is contained in:
14
robot.py
14
robot.py
@@ -136,6 +136,7 @@ class Robot(Job):
|
||||
else: # 接了 ChatGPT,智能回复
|
||||
# 去除@的人和空格等字符
|
||||
q = re.sub(r"@.*?[\u2005|\s]", "", msg.content).replace(" ", "")
|
||||
print(f"toChitchat{q}")
|
||||
# 所有人员都可以要求他撤回刚刚的信息
|
||||
if q == '撤回':
|
||||
self.revoke_messages(msg.roomid)
|
||||
@@ -189,11 +190,14 @@ class Robot(Job):
|
||||
self.LOG.error(f"archive_message error: {e}")
|
||||
|
||||
# 记录在群里发的最新消息,可以通过撤回指令撤回
|
||||
if msg.from_self():
|
||||
self.revoke_receive_message(msg)
|
||||
rsp = self.gbm.handle_command(msg.roomid, msg.content)
|
||||
self.sendTextMsg(rsp, msg.roomid, msg.sender)
|
||||
return
|
||||
try:
|
||||
if msg.from_self():
|
||||
self.revoke_receive_message(msg)
|
||||
rsp = self.gbm.handle_command(msg.roomid, msg.content)
|
||||
self.sendTextMsg(rsp, msg.roomid, msg.sender)
|
||||
return
|
||||
except Exception as e:
|
||||
self.LOG.error(f"revoke_receive_message error: {e}")
|
||||
|
||||
# 如果在群里被 @
|
||||
if msg.roomid not in self.config.GROUPS: # 不在配置的响应的群列表里,忽略
|
||||
|
||||
Reference in New Issue
Block a user