mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-13 13:25:03 +00:00
Another potential fix for Node.js 13/14 incompatibility
This commit is contained in:
parent
0de53d1fb4
commit
31d3e2b1d7
9 changed files with 33 additions and 31 deletions
|
@ -10,11 +10,9 @@ import { IPluginOptions, logger } from "knub";
|
|||
import { GuildLogs } from "../data/GuildLogs";
|
||||
import { LogType } from "../data/LogType";
|
||||
import * as t from "io-ts";
|
||||
import { tNullable } from "../utils";
|
||||
import { isDiscordRESTError, tNullable } from "../utils";
|
||||
import { ERRORS } from "../RecoverablePluginError";
|
||||
|
||||
import DiscordRESTError = require("eris/lib/errors/DiscordRESTError.js"); // tslint:disable-line
|
||||
|
||||
const ConfigSchema = t.type({
|
||||
log_automatic_actions: t.boolean,
|
||||
case_log_channel: tNullable(t.string),
|
||||
|
@ -277,7 +275,7 @@ export class CasesPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
try {
|
||||
result = await caseLogChannel.createMessage(content, file);
|
||||
} catch (e) {
|
||||
if (e instanceof DiscordRESTError && e.code === 50013) {
|
||||
if (isDiscordRESTError(e) && e.code === 50013) {
|
||||
logger.warn(
|
||||
`Missing permissions to post mod cases in <#${caseLogChannel.id}> in guild ${this.guild.name} (${this.guild.id})`,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue