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

403 Forbidden when sending messages to user after strike ban #246

Open
MattyTheHacker opened this issue Jul 4, 2024 · 6 comments
Open
Labels
bug Something isn't working refactor Improvements to the codebase that do not directly affect users

Comments

@MattyTheHacker
Copy link
Member

image

@MattyTheHacker
Copy link
Member Author

occured following a user being first timed out, then banned following a spam message being sent

@CarrotManMatt
Copy link
Member

Ah, I think this is to do with the fact that a bot can't send a user a message if that user is no longer in any servers that that bot is in. (Although this does need verifying)

I think a solution could be to still attempt to send the message to the user (in case they are in another server) but if it can't be sent, then send a note in the response to the committee member that initiated the strike, to message that member personally?

@CarrotManMatt CarrotManMatt changed the title 403 Forbidden 403 Forbidden when sending messages to user after strike ban Jul 4, 2024
@CarrotManMatt CarrotManMatt added the bug Something isn't working label Jul 4, 2024
@MattyTheHacker
Copy link
Member Author

this also comes back to the issue we saw before around discord not actually indicating in the error why the message failed to send - it could be the user has blocked the bot, that they have privacy settings to a certain thing (i.e. not sharing a server) or something else entirely

@CarrotManMatt
Copy link
Member

Very true. I think reminding the committee member to send a message if TeX-Bot couldn't is still a good fallback. As well as logging that the message send failed of course.

@MattyTheHacker
Copy link
Member Author

MattyTheHacker commented Jul 5, 2024

Would it be useful to roll these issues all into one error handler that we attach to anywhere we send a DM message that clearly says it's encountered a 403, "we tried to send abc to user blah blah but failed, this could be for reasons xyz, or something else completely" message rather than having it shit out the full exception

@CarrotManMatt
Copy link
Member

Yh, would deffo be useful to output that to the log & if it occurred under a command call telling the caller in the response too

@MattyTheHacker MattyTheHacker self-assigned this Jul 5, 2024
@MattyTheHacker MattyTheHacker linked a pull request Jul 5, 2024 that will close this issue
@CarrotManMatt CarrotManMatt added the refactor Improvements to the codebase that do not directly affect users label Jul 5, 2024
@MattyTheHacker MattyTheHacker removed their assignment Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactor Improvements to the codebase that do not directly affect users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants