mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 22:05:01 +00:00
Change DiscordRESTError to DiscordAPIError
This commit is contained in:
parent
be71357ff9
commit
1ad70ffe1a
18 changed files with 50 additions and 50 deletions
|
@ -1,6 +1,6 @@
|
|||
import { MessagePayload, User } from "discord.js";
|
||||
import { logger } from "../logger";
|
||||
import { createChunkedMessage, HOURS, isDiscordRESTError } from "../utils";
|
||||
import { createChunkedMessage, HOURS, isDiscordAPIError } from "../utils";
|
||||
import Timeout = NodeJS.Timeout;
|
||||
|
||||
let dmsDisabled = false;
|
||||
|
@ -30,7 +30,7 @@ export async function sendDM(user: User, content: string | MessagePayload, sourc
|
|||
await user.send(content);
|
||||
}
|
||||
} catch (e) {
|
||||
if (isDiscordRESTError(e) && e.code === 20026) {
|
||||
if (isDiscordAPIError(e) && e.code === 20026) {
|
||||
logger.warn(`Received error code 20026: ${e.message}`);
|
||||
logger.warn("Disabling attempts to send DMs for 1 hour");
|
||||
disableDMs(1 * HOURS);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue