After the bot runs for awhile, I start getting this error and the bot is not able to send messages.
2022-12-14 16:58:34 ERROR src.bot -> Error while sending message: asyncio.run() cannot be called from a running event loop
Traceback (most recent call last):
File "/home/ubuntu/chatGPT-discord-bot/src/bot.py", line 18, in send_message
response += await responses.handle_response(user_message)
File "/home/ubuntu/chatGPT-discord-bot/src/responses.py", line 6, in handle_response
chatbot.refresh_session()
File "/home/ubuntu/.local/lib/python3.10/site-packages/revChatGPT/revChatGPT.py", line 311, in refresh_session
asyncio.run(self.get_cf_cookies())
File "/usr/lib/python3.10/asyncio/runners.py", line 33, in run
raise RuntimeError(
RuntimeError: asyncio.run() cannot be called from a running event loop
/home/ubuntu/chatGPT-discord-bot/src/bot.py:57: RuntimeWarning: coroutine 'AsyncChatbot.get_cf_cookies' was never awaited
logger.exception(f"Error while sending message: {e}")
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
After the bot runs for awhile, I start getting this error and the bot is not able to send messages.