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

Undiscord repeatedly tries to delete messages that the user has no permission to do so. #637

Open
1 of 4 tasks
Clyde6790pGIT opened this issue Jun 11, 2024 · 1 comment
Open
1 of 4 tasks

Comments

@Clyde6790pGIT
Copy link

Clyde6790pGIT commented Jun 11, 2024

Undiscord Version

v5.2.3

Browser

1.66.118 Chromium: 125.0.6422.147 (Official Build) (64-bit)

Extension

ViolentMonkey

Reproduction steps

  1. Try to delete messages in an old server that no one uses anymore
  2. Watch it bulk delete everything

Actual results

it is repeatedly trying to delete bot messages it cannot delete even tho everything including authtoken is set correctly and it does not delete other messages at all

Expected results

It should skip bot messages or messages in general that it cannot delete due to the error of not having perms to do so that it can disregard those messages and not repeatedly try to delete them.

Bug affects

  • DMs
  • DMs (group)
  • Channels
  • Channel (NSFW)

Additional information & file uploads

It keeps going back to the undeletable messages even after it deletes a message older than it.
(Potential solution: try to skip messages that cannot be deleted due to the error shown below.)
Error: Error deleting message, API responded with status 403! {"message":"Missing Permissions","code":50013}

@Clyde6790pGIT Clyde6790pGIT changed the title Undiscord repeatedly tries to delete bot messages (like musico) Undiscord repeatedly tries to delete messages that the user has no permission to do so. Jun 11, 2024
@ROAJ12
Copy link

ROAJ12 commented Aug 15, 2024

For anyone that is having the same issue
I just check the script code and change this code lines
In your tampermonkey script find this function called "deleteMessage"
Then search for the if that checks if the messages are being deleted too fast
At the end of that if just add this code
else if (resp.status === 403) {
// insufficient permissions to delete the message
log.warn('Insufficient permissions to delete message. Skipping this message.');
this.state.offset++;
this.state.failCount++;
return 'FAIL_SKIP'; // Failed but we will skip it next time
}
It should work and skip the message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants