3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 16:55:03 +00:00

Change DiscordRESTError to DiscordAPIError

This commit is contained in:
Dark 2021-06-30 23:06:02 +02:00
parent bbf52a5951
commit 6e2bd28691
18 changed files with 50 additions and 50 deletions

View file

@ -1,7 +1,7 @@
import { GuildPluginData } from "knub";
import { LogType } from "../data/LogType";
import { LogsPlugin } from "../plugins/Logs/LogsPlugin";
import { findRelevantAuditLogEntry, isDiscordRESTError } from "../utils";
import { findRelevantAuditLogEntry, isDiscordAPIError } from "../utils";
/**
* Wrapper for findRelevantAuditLogEntry() that handles permission errors gracefully.
@ -17,7 +17,7 @@ export async function safeFindRelevantAuditLogEntry(
try {
return await findRelevantAuditLogEntry(pluginData.guild, actionType, userId, attempts, attemptDelay);
} catch (e) {
if (isDiscordRESTError(e) && e.code === 50013) {
if (isDiscordAPIError(e) && e.code === 50013) {
const logs = pluginData.getPlugin(LogsPlugin);
logs.log(LogType.BOT_ALERT, {
body: "Missing permissions to read audit log",