Answer the question
In order to leave comments, you need to log in
How to catch exceptions in asynchronous functions?
For example, a piece of code (new message event in telethon):
@client.on(events.NewMessage(chats=('chat')))
async def normal_handler(event):
print(event.message.id)
posts = await client(functions.messages.GetHistoryRequest(
peer=event.message.to_id,
limit=1,
offset_date=None,
offset_id=0,
max_id=0,
min_id=0,
add_offset=0,
hash=0))
print(posts)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question