Change DiscordRESTError to DiscordAPIError

This commit is contained in:
Dark 2021-06-30 23:06:02 +02:00
parent be71357ff9
commit 1ad70ffe1a
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8
18 changed files with 50 additions and 50 deletions

View file

@ -1,7 +1,7 @@
import { Permissions, Snowflake } from "discord.js";
import { GuildPluginData } from "knub";
import { LogType } from "../../../data/LogType";
import { isDiscordHTTPError, isDiscordRESTError, SECONDS, sleep } from "../../../utils";
import { isDiscordHTTPError, isDiscordAPIError, SECONDS, sleep } from "../../../utils";
import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { ModActionsPluginType } from "../types";
@ -26,7 +26,7 @@ export async function isBanned(
]);
return potentialBan != null;
} catch (e) {
if (isDiscordRESTError(e) && e.code === 10026) {
if (isDiscordAPIError(e) && e.code === 10026) {
// [10026]: Unknown Ban
return false;
}
@ -36,7 +36,7 @@ export async function isBanned(
return false;
}
if (isDiscordRESTError(e) && e.code === 50013) {
if (isDiscordAPIError(e) && e.code === 50013) {
pluginData.getPlugin(LogsPlugin).log(LogType.BOT_ALERT, {
body: `Missing "Ban Members" permission to check for existing bans`,
});