Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on SendMessage if missing permissions #9

Open
CoasterFreakDE opened this issue Mar 20, 2023 · 3 comments
Open

Error on SendMessage if missing permissions #9

CoasterFreakDE opened this issue Mar 20, 2023 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@CoasterFreakDE
Copy link
Member

Ignoring exception in on_message
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.10/site-packages/discord/client.py", line 451, in _run_event
    await coro(*args, **kwargs)
  File "/home/container/opengpt.py", line 313, in on_message
    thinking_message = await send_thinking_message(message)
  File "/home/container/opengpt.py", line 252, in send_thinking_message
    return await message.channel.send("Let me think for a moment... (this may take a while)", reference=message)
  File "/home/container/.local/lib/python3.10/site-packages/discord/abc.py", line 1140, in send
    data = await state.http.send_message(channel.id, params=params)
  File "/home/container/.local/lib/python3.10/site-packages/discord/http.py", line 590, in request
    raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
@CoasterFreakDE CoasterFreakDE added bug Something isn't working good first issue Good for newcomers labels Mar 20, 2023
@ozgvr
Copy link

ozgvr commented Mar 20, 2023

what is the expected behaviour? catch the exception and print an error?

@mccoderpy
Copy link
Contributor

mccoderpy commented Mar 20, 2023

Well checking the permissions before responding would also be an option.

@CoasterFreakDE
Copy link
Member Author

Good question. If the bot has no permission to send a message, there is no way of letting them know. (Only option is to use slashcommands for new conversations)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants