Answer the question
In order to leave comments, you need to log in
Telegram bot latency problem?
Hello, I used the aiogram lib for writing. The problem is that the bot calls a function that makes a request to a web resource. So while this request is being executed, the bot cannot be used, it does not respond, does not process the user's actions in any way. How can this be fixed? Make functions asynchronous or what? Help to understand, please.
Answer the question
In order to leave comments, you need to log in
Wait, is that what they call it?
Do import asyncio
it at the beginning Put your long query here:
async def longrequest():
# ............
asyncio.create_task(longrequest())
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question