Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pytg
- import pytg.utils
- import pytg.receiver
- messages_received = []
- @pytg.utils.coroutine
- def receiver_function(tg_receiver):
- while True:
- message = (yield)
- messages_received.append(message)
- print("message received and added to list of messages received")
- tg_receiver = pytg.receiver.Receiver()
- tg_receiver.start()
- tg_receiver.message(receiver_function(tg_receiver))
- receiver.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement