调整触发场景,机器人管理,只需要发送指令即可,不能自己@自己
This commit is contained in:
8
robot.py
8
robot.py
@@ -139,11 +139,6 @@ class Robot(Job):
|
||||
if q == '撤回':
|
||||
self.revoke_messages(msg.roomid)
|
||||
return True
|
||||
# 如果聊天内容来自自己,则进行指令判断
|
||||
if msg.from_self() and msg.from_group():
|
||||
rsp = GroupBotManager.handle_command(msg.roomid, q)
|
||||
self.sendTextMsg(rsp, msg.roomid, msg.sender)
|
||||
return True
|
||||
if not self.chat: # 没接 ChatGPT,固定回复
|
||||
rsp = "你@我干嘛?"
|
||||
else: # 接了 ChatGPT,智能回复
|
||||
@@ -198,6 +193,9 @@ class Robot(Job):
|
||||
# 记录在群里发的最新消息,可以通过撤回指令撤回
|
||||
if msg.from_self():
|
||||
self.revoke_receive_message(msg)
|
||||
rsp = GroupBotManager.handle_command(msg.roomid, msg.content)
|
||||
self.sendTextMsg(rsp, msg.roomid, msg.sender)
|
||||
return
|
||||
|
||||
# 如果在群里被 @
|
||||
if msg.roomid not in self.config.GROUPS: # 不在配置的响应的群列表里,忽略
|
||||
|
||||
@@ -247,4 +247,4 @@ def simulate_commands():
|
||||
|
||||
|
||||
# 执行模拟命令
|
||||
simulate_commands()
|
||||
# simulate_commands()
|
||||
|
||||
Reference in New Issue
Block a user