Zero6992 / chatGPT-discord-bot

Integrate ChatGPT into your own discord bot
GNU General Public License v2.0
2.6k stars 699 forks source link

reset command error #446

Closed Murat1Na closed 9 months ago

Murat1Na commented 11 months ago

Hey, when i use reset command the bot keep thinking and get this error in console

2023-07-21 16:08:37 ERROR discord.app_commands.tree Ignoring exception in command 'reset' Traceback (most recent call last): File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 828, in _do_call return await self._callback(interaction, **params) # type: ignore File "/home/container/src/bot.py", line 140, in reset client.chatbot = client.get_chatbot_model() File "/home/container/src/aclient.py", line 79, in get_chatbot_model return BardChatbot(session_id=self.bard_session_id) File "/home/container/.local/lib/python3.10/site-packages/Bard.py", line 63, in init self.async_chatbot = self.loop.run_until_complete( File "/usr/local/lib/python3.10/asyncio/base_events.py", line 625, in run_until_complete self._check_running() File "/usr/local/lib/python3.10/asyncio/base_events.py", line 584, in _check_running raise RuntimeError('This event loop is already running') RuntimeError: This event loop is already running The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/tree.py", line 1248, in _call await command._invoke_with_namespace(interaction, namespace) File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 853, in _invoke_with_namespace return await self._do_call(interaction, transformed_values) File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 846, in _do_call raise CommandInvokeError(self, e) from e discord.app_commands.errors.CommandInvokeError: Command 'reset' raised an exception: RuntimeError: This event loop is already running /home/container/.local/lib/python3.10/site-packages/discord/app_commands/tree.py:1252: RuntimeWarning: coroutine 'AsyncChatbot.create' was never awaited await self.on_error(interaction, e) RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Zero6992 commented 9 months ago

fixed