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 deleting message: Bad status code Bad Request when encountering archived channel messages #48

Open
larryqiann opened this issue Jul 18, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@larryqiann
Copy link

Hi,

I am receiving the error as follows:

INFO[0264] Deleting message 8xxxxx from channel 8xxxxxxxx
DEBU[0264] DELETE https://discord.com/api/v8/channels/8xxxxxxx/messages/8xxxxxxxxxx
DEBU[0264] Server returned status Bad Request           
FATA[0264] Error deleting message: Bad status code Bad Request 

When I manually put this channel ID into the web Discord, it shows that the channel name is of an archived thread in a server that has some threads that were auto archived. These are not deletable, even in the UI.

Since this appears to stop the process and block, I am wondering if it would be possible to detect this case and skip the messages, possibly notifying the user of this situation.

Thanks

@cedws cedws added the bug Something isn't working label Jul 31, 2022
@cedws
Copy link
Owner

cedws commented Aug 1, 2022

Need to add a check to see if the message is in an archived thread. This information isn't available from the messages endpoint - will need to do a lookup of the channel ID.

It would also be worth checking if the user can unarchive the thread.

@cedws
Copy link
Owner

cedws commented Aug 10, 2022

I've added a check in 1.7.0 to see if the message is in an archived or locked thread before attempting deletion. For now, such messages will be skipped, but in a future release I'd like to add some code to try and unarchive/unlock the thread.

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

No branches or pull requests

2 participants