Zero6992 / chatGPT-discord-bot

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

Bot Not Replying Throwing Error When Using /Chat #392

Closed fmunim closed 1 year ago

fmunim commented 1 year ago

Getting this error using /chat:

2023-05-08 04:49:19 ERROR    discord.app_commands.tree Ignoring exception in command 'chat'
Traceback (most recent call last):
  File "/home/rayz/gpt/src/aclient.py", line 135, in send_message
    await message.followup.send(response)
  File "/home/rayz/gpt/env/lib/python3.10/site-packages/discord/webhook/async_.py", line 1800, in send
    data = await adapter.execute_webhook(
  File "/home/rayz/gpt/env/lib/python3.10/site-packages/discord/webhook/async_.py", line 219, in request
    raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10015): Unknown Webhook

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rayz/gpt/env/lib/python3.10/site-packages/discord/app_commands/commands.py", line 842, in _do_call
    return await self._callback(interaction, **params)  # type: ignore
  File "/home/rayz/gpt/src/bot.py", line 34, in chat
    await client.send_message(interaction, message)
  File "/home/rayz/gpt/src/aclient.py", line 140, in send_message
    await message.followup.send(f"> **__ERROR:__** Either OpenAI is down, bot is broken or you are being rate-limited. Try again soon! \n ```ERROR MESSAGE: {e}```")
  File "/home/rayz/gpt/env/lib/python3.10/site-packages/discord/webhook/async_.py", line 1800, in send
    data = await adapter.execute_webhook(
  File "/home/rayz/gpt/env/lib/python3.10/site-packages/discord/webhook/async_.py", line 219, in request
    raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10015): Unknown Webhook

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

Traceback (most recent call last):
  File "/home/rayz/gpt/env/lib/python3.10/site-packages/discord/app_commands/tree.py", line 1248, in _call
    await command._invoke_with_namespace(interaction, namespace)
  File "/home/rayz/gpt/env/lib/python3.10/site-packages/discord/app_commands/commands.py", line 867, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
  File "/home/rayz/gpt/env/lib/python3.10/site-packages/discord/app_commands/commands.py", line 860, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'chat' raised an exception: NotFound: 404 Not Found (error code: 10015): Unknown Webhook
fmunim commented 1 year ago

Any solutions on this @Zero6992?

Zero6992 commented 1 year ago

I haven't encountered similar issue. What's your environment?

Zero6992 commented 1 year ago

Perhaps you can try on a new bot application? Just for testing purposes

fmunim commented 1 year ago

I haven't encountered similar issue. What's your environment?

Environment is Ubuntu 22.04. Python 3.10.6

fmunim commented 1 year ago

Perhaps you can try on a new bot application? Just for testing purposes

I will try thanks!

fmunim commented 1 year ago

Seems like it was my error. I modified something I shouldn't have but fresh pull works! thanks! 👍🏽

DifficultPhil commented 1 year ago

Seems like it was my error. I modified something I shouldn't have but fresh pull works! thanks! 👍🏽

what u change? i have this error...