victornpb / undiscord

Undiscord - Delete all messages in a Discord server / channel or DM (Easy and fast) Bulk delete
https://victornpb.github.io/undiscord
MIT License
5.44k stars 723 forks source link

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

Open Clyde6790pGIT opened 5 months ago

Clyde6790pGIT commented 5 months ago

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

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}

ROAJ12 commented 3 months ago

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