ediziks / BingGPT-Discord-Bot

BingGPT Discord Bot that can handle /ask & /imagine prompts using reverse engineered API of Microsoft's Bing Chat under the hood
The Unlicense
120 stars 14 forks source link

Server rejected WebSocket connection: HTTP 200 #22

Closed Vivi4n closed 6 months ago

Vivi4n commented 1 year ago

Hey there, getting this stacktrace:

2023-09-21 23:31:36 WARNING  discord.bot server rejected WebSocket connection: HTTP 200
2023-09-21 23:31:37 WARNING  discord.bot Command 'ask' raised an exception: UnboundLocalError: local variable 'res' referenced before assignment
Task exception was never retrieved
future: <Task finished name='CommandTree-invoker' coro=<CommandTree._from_interaction.<locals>.wrapper() done, defined at /usr/local/lib/python3.9/dist-packages/discord/app_commands/tree.py:1087> exception=InteractionResponded('This interaction has already been responded to before')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/discord/app_commands/commands.py", line 828, in _do_call
    return await self._callback(interaction, **params)  # type: ignore
  File "/root/BingGPT-Discord-Bot/src/bot.py", line 75, in ask
    ans = res[0]
UnboundLocalError: local variable 'res' referenced before assignment

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/discord/app_commands/tree.py", line 1248, in _call
    await command._invoke_with_namespace(interaction, namespace)
  File "/usr/local/lib/python3.9/dist-packages/discord/app_commands/commands.py", line 853, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
  File "/usr/local/lib/python3.9/dist-packages/discord/app_commands/commands.py", line 846, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'ask' raised an exception: UnboundLocalError: local variable 'res' referenced before assignment

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/discord/app_commands/tree.py", line 1089, in wrapper
    await self._call(interaction)
  File "/usr/local/lib/python3.9/dist-packages/discord/app_commands/tree.py", line 1251, in _call
    await command._invoke_error_handlers(interaction, e)
  File "/usr/local/lib/python3.9/dist-packages/discord/app_commands/commands.py", line 772, in _invoke_error_handlers
    await self.on_error(interaction, error)  # type: ignore
  File "/root/BingGPT-Discord-Bot/src/bot.py", line 146, in ask_error
    await interaction.response.send_message(
  File "/usr/local/lib/python3.9/dist-packages/discord/interactions.py", line 774, in send_message
    raise InteractionResponded(self._parent)
discord.errors.InteractionResponded: This interaction has already been responded to before

Upon using the /ask feature. /imagine seems to work just fine without any issues.

These are the only logs I'm able to find as I'm currently unable to locate anything like bot.log under src/

Any suggestions appreciated :P

YoukaiCat commented 7 months ago

I have the same issue

screen

helsan74 commented 6 months ago

Same here? Any update?

ediziks commented 6 months ago

33