Made MtProtoSender multi-thread safe

This will allow you to, for example, send requests
when you get an update (if someone tells you something,
you can automatically reply something else). Beware,
this may lead to an infinite loop so add conditions!
This commit is contained in:
Lonami
2016-09-10 11:01:03 +02:00
parent e47344c0f0
commit 72bc9df683
2 changed files with 44 additions and 37 deletions

View File

@@ -74,8 +74,8 @@ if __name__ == '__main__':
date = datetime.fromtimestamp(msg.date)
print('[{}:{}] {}: {}'.format(date.hour, date.minute, name, msg.message))
# Send chat message
else:
# Send chat message (if any)
elif msg:
client.send_message(input_peer, msg, markdown=True, no_web_page=True)
print('Thanks for trying the interactive example! Exiting...')