From ea4212d3ab18c243cd4786a544ccaa76396d5a22 Mon Sep 17 00:00:00 2001 From: JandereDev Date: Sat, 20 Nov 2021 15:03:58 +0100 Subject: [PATCH] switch to my own version of revolt.js -> https://github.com/revoltchat/revolt.js/pull/26 --- package.json | 2 +- src/bot/commands/bot_managers.ts | 4 +-- src/bot/commands/debug.ts | 2 +- src/bot/commands/eval.ts | 2 +- src/bot/commands/help.ts | 2 +- src/bot/commands/moderator.ts | 4 +-- src/bot/commands/ping.ts | 2 +- src/bot/commands/prefix.ts | 2 +- src/bot/commands/purge.ts | 2 +- src/bot/commands/settings.ts | 2 +- src/bot/commands/shell_eval.ts | 2 +- src/bot/commands/test.ts | 2 +- src/bot/commands/warn.ts | 2 +- src/bot/commands/warns.ts | 2 +- src/bot/commands/whitelist.ts | 4 +-- src/bot/modules/antispam.ts | 2 +- src/bot/modules/mod_logs.ts | 4 +-- src/bot/util.ts | 4 +-- src/index.ts | 2 +- src/struct/AutomodClient.ts | 2 +- yarn.lock | 45 ++++++++++++++++++-------------- 21 files changed, 50 insertions(+), 45 deletions(-) diff --git a/package.json b/package.json index fcffeed..52fa942 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "author": "", "license": "ISC", "dependencies": { + "@janderedev/revolt.js": "^5.1.0-alpha.9-patch.0", "@types/monk": "^6.0.0", "axios": "^0.22.0", "dayjs": "^1.10.7", @@ -19,7 +20,6 @@ "form-data": "^4.0.0", "log75": "2.0.1", "monk": "^7.3.4", - "revolt.js": "^5.1.0-alpha.9", "ulid": "^2.3.0", "xlsx": "^0.17.3" }, diff --git a/src/bot/commands/bot_managers.ts b/src/bot/commands/bot_managers.ts index 8b9f391..9e445a2 100644 --- a/src/bot/commands/bot_managers.ts +++ b/src/bot/commands/bot_managers.ts @@ -1,9 +1,9 @@ import Command from "../../struct/Command"; -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; import { hasPerm, parseUser } from "../util"; import ServerConfig from "../../struct/ServerConfig"; import { client } from "../.."; -import { User } from "revolt.js/dist/maps/Users"; +import { User } from "@janderedev/revolt.js/dist/maps/Users"; const SYNTAX = '/admin add @user; /admin remove @user; /admin list'; diff --git a/src/bot/commands/debug.ts b/src/bot/commands/debug.ts index b78bbb9..506a1ca 100644 --- a/src/bot/commands/debug.ts +++ b/src/bot/commands/debug.ts @@ -1,5 +1,5 @@ import Command from "../../struct/Command"; -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; export default { name: 'debug', diff --git a/src/bot/commands/eval.ts b/src/bot/commands/eval.ts index ee306e0..a6e15aa 100644 --- a/src/bot/commands/eval.ts +++ b/src/bot/commands/eval.ts @@ -1,5 +1,5 @@ import Command from "../../struct/Command"; -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; import { inspect } from 'util'; import { client } from "../.."; diff --git a/src/bot/commands/help.ts b/src/bot/commands/help.ts index 1c73589..f3e7d07 100644 --- a/src/bot/commands/help.ts +++ b/src/bot/commands/help.ts @@ -1,5 +1,5 @@ import Command from "../../struct/Command"; -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; export default { name: 'help', diff --git a/src/bot/commands/moderator.ts b/src/bot/commands/moderator.ts index 6bd2f7d..d0dc9a9 100644 --- a/src/bot/commands/moderator.ts +++ b/src/bot/commands/moderator.ts @@ -1,9 +1,9 @@ import Command from "../../struct/Command"; -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; import { isBotManager, NO_MANAGER_MSG, parseUser } from "../util"; import ServerConfig from "../../struct/ServerConfig"; import { client } from "../.."; -import { User } from "revolt.js/dist/maps/Users"; +import { User } from "@janderedev/revolt.js/dist/maps/Users"; const SYNTAX = '/mod add @user; /mod remove @user; /mod list'; diff --git a/src/bot/commands/ping.ts b/src/bot/commands/ping.ts index ab97b33..89e9021 100644 --- a/src/bot/commands/ping.ts +++ b/src/bot/commands/ping.ts @@ -1,5 +1,5 @@ import Command from "../../struct/Command"; -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; import { client } from "../.."; export default { diff --git a/src/bot/commands/prefix.ts b/src/bot/commands/prefix.ts index c0e4c42..c37564d 100644 --- a/src/bot/commands/prefix.ts +++ b/src/bot/commands/prefix.ts @@ -1,5 +1,5 @@ import Command from "../../struct/Command"; -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; import { client } from "../.."; import ServerConfig from "../../struct/ServerConfig"; import { DEFAULT_PREFIX } from "../modules/command_handler"; diff --git a/src/bot/commands/purge.ts b/src/bot/commands/purge.ts index e134d15..3ff5736 100644 --- a/src/bot/commands/purge.ts +++ b/src/bot/commands/purge.ts @@ -1,5 +1,5 @@ import Command from "../../struct/Command"; -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; import { decodeTime } from 'ulid'; import { isModerator, parseUser } from "../util"; diff --git a/src/bot/commands/settings.ts b/src/bot/commands/settings.ts index 2dfbf27..7570ddf 100644 --- a/src/bot/commands/settings.ts +++ b/src/bot/commands/settings.ts @@ -1,5 +1,5 @@ import Command from "../../struct/Command"; -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; import { client } from "../.."; import AutomodSettings from "../../struct/antispam/AutomodSettings"; import AntispamRule from "../../struct/antispam/AntispamRule"; diff --git a/src/bot/commands/shell_eval.ts b/src/bot/commands/shell_eval.ts index 9a1f722..684ce9f 100644 --- a/src/bot/commands/shell_eval.ts +++ b/src/bot/commands/shell_eval.ts @@ -1,5 +1,5 @@ import Command from "../../struct/Command"; -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; import { exec } from 'child_process'; export default { diff --git a/src/bot/commands/test.ts b/src/bot/commands/test.ts index 9a3ed92..cc75713 100644 --- a/src/bot/commands/test.ts +++ b/src/bot/commands/test.ts @@ -1,5 +1,5 @@ import Command from "../../struct/Command"; -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; export default { name: 'test', diff --git a/src/bot/commands/warn.ts b/src/bot/commands/warn.ts index 05328de..116e191 100644 --- a/src/bot/commands/warn.ts +++ b/src/bot/commands/warn.ts @@ -1,5 +1,5 @@ import Command from "../../struct/Command"; -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; import { isModerator, NO_MANAGER_MSG, parseUser, storeInfraction } from "../util"; import Infraction from "../../struct/antispam/Infraction"; import { ulid } from "ulid"; diff --git a/src/bot/commands/warns.ts b/src/bot/commands/warns.ts index 6edb94d..8821067 100644 --- a/src/bot/commands/warns.ts +++ b/src/bot/commands/warns.ts @@ -1,5 +1,5 @@ import Command from "../../struct/Command"; -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; import { client } from "../.."; import Infraction from "../../struct/antispam/Infraction"; import InfractionType from "../../struct/antispam/InfractionType"; diff --git a/src/bot/commands/whitelist.ts b/src/bot/commands/whitelist.ts index f5a330f..6f404a5 100644 --- a/src/bot/commands/whitelist.ts +++ b/src/bot/commands/whitelist.ts @@ -1,5 +1,5 @@ -import { Message } from "revolt.js/dist/maps/Messages"; -import { User } from "revolt.js/dist/maps/Users"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; +import { User } from "@janderedev/revolt.js/dist/maps/Users"; import { client } from "../.."; import Command from "../../struct/Command"; import ServerConfig from "../../struct/ServerConfig"; diff --git a/src/bot/modules/antispam.ts b/src/bot/modules/antispam.ts index 3682c4d..3a6bdbc 100644 --- a/src/bot/modules/antispam.ts +++ b/src/bot/modules/antispam.ts @@ -1,4 +1,4 @@ -import { Message } from "revolt.js/dist/maps/Messages"; +import { Message } from "@janderedev/revolt.js/dist/maps/Messages"; import { ulid } from "ulid"; import { client } from "../.."; import AntispamRule from "../../struct/antispam/AntispamRule"; diff --git a/src/bot/modules/mod_logs.ts b/src/bot/modules/mod_logs.ts index 36c6fa4..03a663b 100644 --- a/src/bot/modules/mod_logs.ts +++ b/src/bot/modules/mod_logs.ts @@ -1,5 +1,5 @@ -import { Member } from "revolt.js/dist/maps/Members"; -import { User } from "revolt.js/dist/maps/Users"; +import { Member } from "@janderedev/revolt.js/dist/maps/Members"; +import { User } from "@janderedev/revolt.js/dist/maps/Users"; import { client } from "../.."; import ServerConfig from "../../struct/ServerConfig"; import logger from "../logger"; diff --git a/src/bot/util.ts b/src/bot/util.ts index 8d6992d..3f43120 100644 --- a/src/bot/util.ts +++ b/src/bot/util.ts @@ -1,5 +1,5 @@ -import { Member } from "revolt.js/dist/maps/Members"; -import { User } from "revolt.js/dist/maps/Users"; +import { Member } from "@janderedev/revolt.js/dist/maps/Members"; +import { User } from "@janderedev/revolt.js/dist/maps/Users"; import { client } from ".."; import Infraction from "../struct/antispam/Infraction"; import ServerConfig from "../struct/ServerConfig"; diff --git a/src/index.ts b/src/index.ts index 401e54c..be91376 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,7 @@ import MongoDB from './bot/db'; logger.info('Initializing client'); let db = MongoDB(); -let client = new AutomodClient({ /* client config */ }, db); +let client = new AutomodClient({ pongTimeout: 10, onPongTimeout: 'RECONNECT' }, db); login(client); export { client } diff --git a/src/struct/AutomodClient.ts b/src/struct/AutomodClient.ts index 5555528..9deea8e 100644 --- a/src/struct/AutomodClient.ts +++ b/src/struct/AutomodClient.ts @@ -1,4 +1,4 @@ -import * as Revolt from 'revolt.js'; +import * as Revolt from "@janderedev/revolt.js"; import { IMonkManager } from 'monk'; import logger from '../bot/logger'; diff --git a/yarn.lock b/yarn.lock index 0cf558e..57290a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,22 @@ # yarn lockfile v1 +"@janderedev/revolt.js@^5.1.0-alpha.9-patch.0": + version "5.1.0-alpha.9-patch.0" + resolved "https://registry.yarnpkg.com/@janderedev/revolt.js/-/revolt.js-5.1.0-alpha.9-patch.0.tgz#de1da9e4d09b6d07f341b9d7590a730f185de84a" + integrity sha512-9fzZ/hCy16//UOIHT0k7dDPyD+Wl/ijTU/wCM25EQcz2saUgBcwatjrVp2KJ0/jZmqiiYHQayCRCku2WJCyZcQ== + dependencies: + axios "^0.21.4" + eventemitter3 "^4.0.7" + exponential-backoff "^3.1.0" + isomorphic-ws "^4.0.1" + lodash.defaultsdeep "^4.6.1" + lodash.isequal "^4.5.0" + mobx "^6.3.2" + revolt-api "^0.5.3-alpha.8-patch.0" + ulid "^2.3.0" + ws "^8.2.2" + "@types/bson@*": version "4.2.0" resolved "https://registry.yarnpkg.com/@types/bson/-/bson-4.2.0.tgz#a2f71e933ff54b2c3bf267b67fa221e295a33337" @@ -187,7 +203,12 @@ fflate@^0.7.1: resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.7.1.tgz#56e87e87c3f2fe01b025fbb1c4ea835990c02fa2" integrity sha512-VYM2Xy1gSA5MerKzCnmmuV2XljkpKwgJBKezW+495TTnTCh1x5HcYa1aH8wRU/MfTGhW4ziXqgwprgQUVl3Ohw== -follow-redirects@^1.14.0, follow-redirects@^1.14.4: +follow-redirects@^1.14.0: + version "1.14.5" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.5.tgz#f09a5848981d3c772b5392309778523f8d85c381" + integrity sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA== + +follow-redirects@^1.14.4: version "1.14.4" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.4.tgz#838fdf48a8bbdd79e52ee51fb1c94e3ed98b9379" integrity sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g== @@ -261,9 +282,9 @@ mime-types@^2.1.12: mime-db "1.50.0" mobx@^6.3.2: - version "6.3.3" - resolved "https://registry.yarnpkg.com/mobx/-/mobx-6.3.3.tgz#a3006c56243b1c7ea4ee671a66f963b9f43cf1af" - integrity sha512-JoNU50rO6d1wHwKPJqKq4rmUMbYnI9CsJmBo+Cu4exBYenFvIN77LWrZENpzW6reZPADtXMmB1DicbDSfy8Clw== + version "6.3.7" + resolved "https://registry.yarnpkg.com/mobx/-/mobx-6.3.7.tgz#9ed85561e86da45141134c8fa20cf5f9c7246c3d" + integrity sha512-X7yU7eOEyxIBk4gjIi2UIilwdw48gXh0kcZ5ex3Rc+COJsJmJ4SNpf42uYea3aUqb1hedTv5xzJrq5Q55p0P5g== mongodb@^3.2.3: version "3.7.2" @@ -384,22 +405,6 @@ revolt-api@^0.5.3-alpha.8-patch.0: resolved "https://registry.yarnpkg.com/revolt-api/-/revolt-api-0.5.3-alpha.8-patch.0.tgz#3c9f981f8100a89aec1299bc110453cf01c51f89" integrity sha512-ghupcB1nJS7fCiD41L4u+QudFoBWGE381uW4s8cuHsQS3bFXgzAH1lgtjYNoFgrVUekqQAcHWote8Kn2sOABAQ== -revolt.js@^5.1.0-alpha.9: - version "5.1.0-alpha.9" - resolved "https://registry.yarnpkg.com/revolt.js/-/revolt.js-5.1.0-alpha.9.tgz#ce3bff9eb0778160270f8af68c7a64b790cac095" - integrity sha512-tBrKvyStA2Q1LTMgyqrOMjAdTYRucE6ZFEZtt5BW6MJ3r7MEMZkqXorU6L/3PE233jqQbHTFDqz8IhyPCfUA3A== - dependencies: - axios "^0.21.4" - eventemitter3 "^4.0.7" - exponential-backoff "^3.1.0" - isomorphic-ws "^4.0.1" - lodash.defaultsdeep "^4.6.1" - lodash.isequal "^4.5.0" - mobx "^6.3.2" - revolt-api "^0.5.3-alpha.8-patch.0" - ulid "^2.3.0" - ws "^8.2.2" - safe-buffer@^5.1.1, safe-buffer@^5.1.2: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"