Traceback (most recent call last):
File "F:\Projects\Git\tg_bot\app.py", line 20, in <module>
asyncio.create_task(background_task())
File "C:\Users\Mearise\AppData\Local\Programs\Python\Python39\lib\asyncio\tasks.py", line 360, in create_task
loop = events.get_running_loop()
RuntimeError: no running event loop
sys:1: RuntimeWarning: coroutine 'background_task' was never awaited
Traceback (most recent call last):
File "D:/OTHERS/bot/test.py", line 32, in <module>
loop.run_until_complete(main())
File "C:\Program Files\bin\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "D:/OTHERS/bot/test.py", line 16, in main
data = await longpoll.wait()
File "C:\Users\adm\AppData\Roaming\Python\Python38\site-packages\aiovk\longpoll.py", line 62, in wait
code, response = await self.api._session.driver.get_text(
File "C:\Users\adm\AppData\Roaming\Python\Python38\site-packages\aiovk\drivers.py", line 61, in get_text
async with self.session.get(url, params=params, timeout=timeout or self.timeout) as response:
File "C:\Users\adm\AppData\Roaming\Python\Python38\site-packages\aiohttp\client.py", line 1012, in __aenter__
self._resp = await self._coro
File "C:\Users\adm\AppData\Roaming\Python\Python38\site-packages\aiohttp\client.py", line 504, in _request
await resp.start(conn)
File "C:\Users\adm\AppData\Roaming\Python\Python38\site-packages\aiohttp\client_reqrep.py", line 847, in start
message, payload = await self._protocol.read() # type: ignore # noqa
File "C:\Users\adm\AppData\Roaming\Python\Python38\site-packages\aiohttp\streams.py", line 591, in read
await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError
Process finished with exit code 1
Unicode-objects must be encoded before hashing
if payload == '{"button":"1"}':
asyncio.create_task(api('messages.send',
peer_id=event['object']['message']['peer_id'],
message="game 1\n",
random_id=0,
keyboard=keyboardReturnMenu))
elif event.object.message['payload'] == '{"button":"2"}':