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

V5.0.1 #355

Merged
merged 3 commits into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions deleteDiscordMessages.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Undiscord
// @description Delete all messages in a Discord channel or DM (Bulk deletion)
// @version 5.0.0
// @version 5.0.1
// @author victornpb
// @homepageURL https://github.com/victornpb/undiscord
// @supportURL https://github.com/victornpb/undiscord/issues
Expand All @@ -17,7 +17,7 @@
(function () {
'use strict';

var version = "5.0.0";
var version = "5.0.1";

var discordStyles = (`
/* undiscord window */
Expand Down Expand Up @@ -772,7 +772,7 @@

// not indexed yet
if (resp.status === 202) {
const w = (await resp.json()).retry_after;
const w = (await resp.json()).retry_after * 1000;
throttledCount++;
throttledTotalTime += w;
log.warn(`This channel wasn't indexed, waiting ${w}ms for discord to index it...`);
Expand All @@ -783,7 +783,7 @@
if (!resp.ok) {
// searching messages too fast
if (resp.status === 429) {
const w = (await resp.json()).retry_after;
const w = (await resp.json()).retry_after * 1000;
throttledCount++;
throttledTotalTime += w;
searchDelay += w; // increase delay
Expand Down Expand Up @@ -867,7 +867,7 @@
if (!resp.ok) {
// deleting messages too fast
if (resp.status === 429) {
const w = (await resp.json()).retry_after;
const w = (await resp.json()).retry_after * 1000;
throttledCount++;
throttledTotalTime += w;
deleteDelay = w; // increase delay
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"contributionURL": "https://www.buymeacoffee.com/vitim",
"grant": "none"
},
"version": "5.0.0",
"version": "5.0.1",
"description": "Delete all messages in a Discord channel or DM (Bulk deletion)",
"license": "MIT",
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions src/deleteMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async function deleteMessages(authToken, authorId, guildId, channelId, minId, ma

// not indexed yet
if (resp.status === 202) {
const w = (await resp.json()).retry_after;
const w = (await resp.json()).retry_after * 1000;
throttledCount++;
throttledTotalTime += w;
log.warn(`This channel wasn't indexed, waiting ${w}ms for discord to index it...`);
Expand All @@ -95,7 +95,7 @@ async function deleteMessages(authToken, authorId, guildId, channelId, minId, ma
if (!resp.ok) {
// searching messages too fast
if (resp.status === 429) {
const w = (await resp.json()).retry_after;
const w = (await resp.json()).retry_after * 1000;
throttledCount++;
throttledTotalTime += w;
searchDelay += w; // increase delay
Expand Down Expand Up @@ -179,7 +179,7 @@ async function deleteMessages(authToken, authorId, guildId, channelId, minId, ma
if (!resp.ok) {
// deleting messages too fast
if (resp.status === 429) {
const w = (await resp.json()).retry_after;
const w = (await resp.json()).retry_after * 1000;
throttledCount++;
throttledTotalTime += w;
deleteDelay = w; // increase delay
Expand Down