Skip to content

Commit

Permalink
Merge pull request #355 from victornpb/v5.0.1
Browse files Browse the repository at this point in the history
V5.0.1
  • Loading branch information
victornpb authored May 2, 2022
2 parents dab68e6 + a6cf167 commit 22da3c0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
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

0 comments on commit 22da3c0

Please sign in to comment.