We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f889b0 commit acf5dd9Copy full SHA for acf5dd9
bot.py
@@ -47,16 +47,17 @@ def auto_switch(self, msg):
47
START = [u'出来', u'启动', u'工作']
48
if self.robot_switch:
49
for i in STOP:
50
- if i in msg_data :
+ if i == msg_data:
51
self.robot_switch = False
52
self.send_msg_by_uid(u'[Robot]' + u'机器人已关闭!', msg['to_user_id'])
53
else:
54
for i in START:
55
- if i in msg_data:
56
self.robot_switch = True
57
+ self.send_msg_by_uid(u'[Robot]' + u'机器人已开启!', msg['to_user_id'])
58
59
def handle_msg_all(self, msg):
- if not self.robot_switch:
60
+ if not self.robot_switch and msg['msg_type_id'] != 1:
61
return
62
if msg['msg_type_id'] == 1 and msg['content']['type'] == 0: # reply to self
63
self.auto_switch(msg)
0 commit comments