Zero6992 / chatGPT-discord-bot

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

Runs locally, but throws error in Heroku or Replit #335

Closed vatsalkaushik closed 1 year ago

vatsalkaushik commented 1 year ago

The bot runs without any issues when run locally, but I tried running it via Heroku and Replit and both give me the following error:

Traceback (most recent call last):
  File "/home/runner/AltruisticUtterWorker/venv/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/runner/AltruisticUtterWorker/src/bot.py", line 30, in chat
    await client.send_message(interaction, message)
  File "/home/runner/AltruisticUtterWorker/src/aclient.py", line 36, in send_message
    author = message.author.id
AttributeError: 'Interaction' object has no attribute 'author'

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

Traceback (most recent call last):
  File "/home/runner/AltruisticUtterWorker/venv/lib/python3.10/site-packages/discord/app_commands/tree.py", line 1248, in _call
    await command._invoke_with_namespace(interaction, namespace)
  File "/home/runner/AltruisticUtterWorker/venv/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/runner/AltruisticUtterWorker/venv/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: AttributeError: 'Interaction' object has no attribute 'author'
Zero6992 commented 1 year ago

There are no issues with running the code on Heroku using Docker