bandaged up for d.js 14

This commit is contained in:
Emily 2022-12-06 09:44:25 +11:00
parent 022ec6b999
commit acba68a2d1
4 changed files with 1293 additions and 1362 deletions

3
.gitignore vendored
View File

@ -3,4 +3,5 @@ botconfig.json
Lavalink.jar Lavalink.jar
logs logs
*.log *.log
node_modules node_modules
.vscode

View File

@ -6,12 +6,11 @@ const EventLoader = require('./util/eventLoader');
const EventHandler = require('./util/handlers/eventHandler'); const EventHandler = require('./util/handlers/eventHandler');
const MessageHandler = require('./util/handlers/messageHandler'); const MessageHandler = require('./util/handlers/messageHandler');
const Functions = require('./util/functions'); const Functions = require('./util/functions');
const Database = require('./util/database'); // const Database = require('./util/database');
const Logger = require('./util/logger'); const Logger = require('./util/logger');
const sentry = require('@sentry/node'); const sentry = require('@sentry/node');
const config = require('../botconfig.json'); const config = require('../botconfig.json');
const version = require('../package.json').version; const version = require('../package.json').version;
class WoomyClient extends Discord.Client { class WoomyClient extends Discord.Client {
constructor (options) { constructor (options) {
super(options); super(options);
@ -24,7 +23,7 @@ class WoomyClient extends Discord.Client {
// Essential modules // Essential modules
this.logger = Logger; this.logger = Logger;
this.MessageEmbed = Discord.MessageEmbed; this.MessageEmbed = Discord.MessageEmbed;
this.db = new Database(this); //this.db = new Database(this);
this.functions = new Functions(this); this.functions = new Functions(this);
this.commandLoader = new CommandLoader(this); this.commandLoader = new CommandLoader(this);
this.eventLoader = new EventLoader(this); this.eventLoader = new EventLoader(this);
@ -50,7 +49,7 @@ class WoomyClient extends Discord.Client {
this.on('voiceStateUpdate', this.runVoiceStateUpdateModules); this.on('voiceStateUpdate', this.runVoiceStateUpdateModules);
} }
// Recieves information from the per-event listeners, and passes on needed information to the handler // Receives information from the per-event listeners, and passes on needed information to the handler
mainEventListener (wsEvent, param_1, param_2) { mainEventListener (wsEvent, param_1, param_2) {
try { try {
this.eventHandler.handle(wsEvent, param_1, param_2); this.eventHandler.handle(wsEvent, param_1, param_2);
@ -97,16 +96,20 @@ class WoomyClient extends Discord.Client {
// Initialize our client // Initialize our client
const client = new WoomyClient({ const client = new WoomyClient({
shards: 'auto', shards: 'auto',
partials: [
Discord.Partials.Reaction,
],
intents: [ intents: [
'GUILDS', Discord.GatewayIntentBits.Guilds,
'GUILD_MEMBERS', Discord.GatewayIntentBits.GuildMembers,
'GUILD_EMOJIS', Discord.GatewayIntentBits.GuildEmojisAndStickers,
'GUILD_VOICE_STATES', Discord.GatewayIntentBits.GuildVoiceStates,
'GUILD_MESSAGES', Discord.GatewayIntentBits.GuildMessages,
'DIRECT_MESSAGES', Discord.GatewayIntentBits.MessageContent,
'GUILD_MESSAGE_REACTIONS', Discord.GatewayIntentBits.GuildMessageReactions,
] ]
}); });
// Extensions of native javascript types, *not good practice* but they're useful // Extensions of native javascript types, *not good practice* but they're useful
require('./util/prototypes'); require('./util/prototypes');
@ -115,7 +118,7 @@ client.commandLoader.loadCommands();
client.eventLoader.loadEventModules(); client.eventLoader.loadEventModules();
client.createEventListeners(); client.createEventListeners();
// Development mode is set in botconfig.yml, and disables some stuff if enabled. Imagine how messy Sentry would be without this! // Development mode is set in botconfig.json
if (client.config.developmentMode === false) { if (client.config.developmentMode === false) {
try { try {
sentry.init({ dsn: client.config.keys.sentry }); sentry.init({ dsn: client.config.keys.sentry });

2615
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,15 +4,15 @@
"description": "Made with <3 by mudkipscience", "description": "Made with <3 by mudkipscience",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@sentry/node": "^6.9.0", "@sentry/node": "^7.23.0",
"bufferutil": "^4.0.3", "bufferutil": "^4.0.3",
"chalk": "^4.1.0", "chalk": "^4.1.2",
"dayjs": "^1.10.6", "dayjs": "^1.10.6",
"discord.js": "^13.0.0-dev.1dcad05.1626134620", "discord.js": "^14.7.1",
"erlpack": "^0.1.3", "erlpack": "^0.1.3",
"eslint": "^7.30.0", "eslint": "^8.29.0",
"fs-readdir-recursive": "^1.1.0", "fs-readdir-recursive": "^1.1.0",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.7",
"pg": "^8.5.1", "pg": "^8.5.1",
"pg-format": "^1.0.4", "pg-format": "^1.0.4",
"pretty-ms": "^7.0.1", "pretty-ms": "^7.0.1",