3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-11 12:55:01 +00:00

Another potential fix for Node.js 13/14 incompatibility

This commit is contained in:
Dragory 2020-05-08 18:29:17 +03:00
parent 0de53d1fb4
commit 31d3e2b1d7
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
9 changed files with 33 additions and 31 deletions

View file

@ -2,10 +2,10 @@ import { decorators as d, IPluginOptions, logger } from "knub";
import { GuildLogs } from "../data/GuildLogs";
import { LogType } from "../data/LogType";
import { Attachment, Channel, Constants as ErisConstants, Embed, Member, TextChannel, User } from "eris";
import DiscordRESTError = require("eris/lib/errors/DiscordRESTError.js"); // tslint:disable-line
import {
createChunkedMessage,
findRelevantAuditLogEntry,
isDiscordRESTError,
messageSummary,
noop,
stripObjectToScalars,
@ -263,7 +263,7 @@ export class LogsPlugin extends ZeppelinPlugin<TConfigSchema> {
try {
return await findRelevantAuditLogEntry(this.guild, actionType, userId, attempts, attemptDelay);
} catch (e) {
if (e instanceof DiscordRESTError && e.code === 50013) {
if (isDiscordRESTError(e) && e.code === 50013) {
this.guildLogs.log(LogType.BOT_ALERT, {
body: "Missing permissions to read audit log",
});