Answer the question
In order to leave comments, you need to log in
Bot on aiogram stops responding to messages, how to solve?
Hello. At the end of the bot is the launch of the cycle, which initializes the launch of the bot.
It all looks like this:
#Выше находятся команды бота
async def main():
polling_task = asyncio.create_task(dp.start_polling())
data = json.loads(await client.recv())
url = "ССЫЛКА НА ВЕБСОКЕТ"
async with websockets.connect(url) as client:
while True:
data = json.loads(await client.recv())
#Далее идёт работа с json массивом и отправка сообщения
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
aiogram.utils.exceptions.NetworkError: Aiohttp client throws an error: ServerDisconnectedError: Server disconnected
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