Allow speaking in only one chat

This commit is contained in:
Alexandr
2019-01-09 14:55:49 +03:00
parent 7f4d4ced56
commit 7e7a4e3cc6

View File

@ -100,6 +100,7 @@ class MessageWorker:
'@' + self.me['result']['username'], '')
except:
input_message = msg['message']['text']
if str(msg['message']['chat']['id']) == "-1001233797421":
if random.randint(0,300) == 1:
conf_id = msg['message']['chat']['id']
user_id = msg['message']['from']['id']
@ -119,7 +120,7 @@ class MessageWorker:
if random.randint(0,100) > 80:
msg = answers[random.randint(0,len(answers)-1)]
self.send(id=conf_id, msg=msg)
if (input_message[0] == 'Ты') or (input_message[0] == 'ты'):
if (input_message[0:1] == 'Ты') or (input_message[0:1] == 'ты'):
if len(input_message) > 5:
conf_id = msg['message']['chat']['id']
user_id = msg['message']['from']['id']