3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-07 19:17:19 +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

@ -1,12 +1,11 @@
import { decorators as d, IPluginOptions, logger } from "knub";
import { CustomEmoji, errorMessage, isSnowflake, noop, sleep } from "../utils";
import { CustomEmoji, errorMessage, isDiscordRESTError, isSnowflake, noop, sleep } from "../utils";
import { GuildReactionRoles } from "../data/GuildReactionRoles";
import { Message, TextChannel } from "eris";
import { ZeppelinPlugin } from "./ZeppelinPlugin";
import { GuildSavedMessages } from "../data/GuildSavedMessages";
import { Queue } from "../Queue";
import { ReactionRole } from "../data/entities/ReactionRole";
import DiscordRESTError = require("eris/lib/errors/DiscordRESTError.js"); // tslint:disable-line
import * as t from "io-ts";
import { ERRORS, RecoverablePluginError } from "../RecoverablePluginError";
import Timeout = NodeJS.Timeout;
@ -143,7 +142,7 @@ export class ReactionRolesPlugin extends ZeppelinPlugin<TConfigSchema> {
try {
targetMessage = await channel.getMessage(messageId);
} catch (e) {
if (e instanceof DiscordRESTError) {
if (isDiscordRESTError(e)) {
if (e.code === 10008) {
// Unknown message, remove reaction roles from the message
logger.warn(