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

Deletion stops after 26 messages in DM #23

Closed
Deevits opened this issue Nov 20, 2019 · 9 comments
Closed

Deletion stops after 26 messages in DM #23

Deevits opened this issue Nov 20, 2019 · 9 comments
Labels
is-bug Something isn't working no-action-duplicate This issue or pull request already exists

Comments

@Deevits
Copy link

Deevits commented Nov 20, 2019

Hi! First of all, thanks for all your effort of coding this thing!
For some reason though, every time I try to delete the messages in DM it stops after 26 messages:

0.12% (26/22548) Deleting ID:641395138689630220 User#9999 (5-11-2019 22:55:17): Wat?
Searching next messages in 100ms...
Total messages found: 22548 (Messages in current page: 0, Author: 0, System: 0) offset: 0
Delete delay: 365ms, Search delay: 100ms Last Ping: 253ms, Average Ping: 198ms
Estimated time remaining: 3h 33m 18s
Ended because API returned an empty page.
Ended at 20-11-2019 13:58:47! Total time: 0h 0m 18s
Delete delay: 365ms, Search delay: 100ms Last Ping: 253ms, Average Ping: 198ms
Rate Limited: 1 times. Total time throttled: 0h 0m 0s.
Deleted 26 messages, 0 failed.

Am I doing something wrong here? Using Chrome.

@charlie721628
Copy link

I am also encountering this issue, I don't think it's on your end. I tried both Chrome and Firefox to no avail.

@tuokri
Copy link

tuokri commented Nov 20, 2019

Confirmed

@ghost
Copy link

ghost commented Nov 21, 2019

Same here, this just started happening in the last week or so I believe. It will find >100 messages and then delete only a few dozen. Repeated attempts find no existing messages when they're obviously still there.

Total messages found: 182	(Messages in current page: 0, Author: 0, System: 0)	offset: 0
Delete delay: 100ms, Search delay: 100ms	Last Ping: 161ms, Average Ping: 161ms
Estimated time remaining: 0h 0m 48s
Ended because API returned an empty page.
Ended at 2019/11/21 13:57:43! Total time: 0h 0m 0s
Delete delay: 100ms, Search delay: 100ms	Last Ping: 161ms, Average Ping: 161ms
Rate Limited: 0 times. Total time throttled: 0h 0m 0s.
Deleted 0 messages, 0 failed.

@tuokri
Copy link

tuokri commented Nov 22, 2019

A few things I noticed:

  • Repeating the deletion attempt after waiting an extended period of time makes it work again (but only up to 26 messages). I didn't measure the time but it ranged from several minutes to an hour.
  • Specifying the message ID range manually makes the deletion work again, but yet again only up to 26 messages.

@FernandoHurtado
Copy link

same problem here

@larryqiann
Copy link

I'm having the same issue. After playing around it looks like the Discord search UI has the same issue and you have to click the "next" button a few times.

@larryqiann
Copy link

larryqiann commented Nov 23, 2019

After some testing I was able to hack it into working. Using inspect element it looks like Discord uses different URLs for searching and for actually deleting.

I made these changes in the code to get it working in a server:

Under the 'recurse' function:
const baseURL = https://discordapp.com/api/v6/guilds/58***64/messages/`;
const baseURLD = https://discordapp.com/api/v6/channels/58***76/messages/;`

However, using this method, we need to implement filtering by channel in search, because otherwise it will find a lot of messages in other channels and try to delete them resulting in 404s. Furthermore, the values are hardcoded right now and need to be updated each time.

Another issue is that I needed to modify the last else block to update the offset to 25*iterations, and then recurse again. This causes some bugs where the script doesn't stop running and just loops so I need to watch it while it is running. Moreover, the reliability is still pretty poor.

@jumphil
Copy link

jumphil commented Nov 26, 2019

I'm having the exact same problem, a fix would be much appreciated

@victornpb victornpb added the is-bug Something isn't working label Dec 1, 2019
@victornpb
Copy link
Owner

After some testing I was able to hack it into working. Using inspect element it looks like Discord uses different URLs for searching and for actually deleting.

I made these changes in the code to get it working in a server:

Under the 'recurse' function:
const baseURL = [https://discordapp.com/api/v6/guilds/5864/messages/](https://discordapp.com/api/v6/guilds/58***64/messages/%60); const baseURLD = https://discordapp.com/api/v6/channels/5876/messages/;

However, using this method, we need to implement filtering by channel in search, because otherwise it will find a lot of messages in other channels and try to delete them resulting in 404s. Furthermore, the values are hardcoded right now and need to be updated each time.

Another issue is that I needed to modify the last else block to update the offset to 25*iterations, and then recurse again. This causes some bugs where the script doesn't stop running and just loops so I need to watch it while it is running. Moreover, the reliability is still pretty poor.

@larryqiann Thank you for this insight. I wasn't aware of this new endpoint, I'm working on it.
I'm closing this issue as duplicate of #24

@victornpb victornpb added the no-action-duplicate This issue or pull request already exists label Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is-bug Something isn't working no-action-duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

7 participants