mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 05:19:41 +00:00
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:
4
main.py
4
main.py
@@ -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...')
|
||||
|
Reference in New Issue
Block a user