Compare commits

...

4 Commits

Author SHA1 Message Date
Emily dfc1674bad i cant remember what half of these were even for 2022-12-09 23:42:09 +11:00
Emily 7e623c36fd oopsie cant spell 2022-12-09 23:41:47 +11:00
Emily b94fc32f46 file layout changes + interaction passoff 2022-12-09 23:41:29 +11:00
Emily dfc1978368 oopsie comma was missing 2022-12-09 23:40:41 +11:00
7 changed files with 13 additions and 9 deletions

View File

@ -20,7 +20,7 @@ module.exports = class {
}
run (client, message, args, data) { //eslint-disable-line no-unused-vars
client.logger.success('RESTART', 'Restart command recieved. ' + exitQuotes.random());
client.logger.success('RESTART', 'Restart command received. ' + exitQuotes.random());
client.disconnect();
client.functions.wait();

View File

@ -3,10 +3,10 @@
const Discord = require('discord.js');
const CommandLoader = require('./util/commandLoader');
const EventLoader = require('./util/eventLoader');
const EventHandler = require('./util/handlers/eventHandler');
const MessageHandler = require('./util/handlers/messageHandler');
const EventHandler = require('./event_modules/eventHandler');
const MessageHandler = require('./event_modules/interactionCreate/messageHandler');
const Functions = require('./util/functions');
// const Database = require('./util/database');
const Database = require('./util/database');
const Logger = require('./util/logger');
const sentry = require('@sentry/node');
const config = require('../botconfig.json');
@ -23,7 +23,7 @@ class WoomyClient extends Discord.Client {
// Essential modules
this.logger = Logger;
this.MessageEmbed = Discord.MessageEmbed;
//this.db = new Database(this);
this.db = new Database(this);
this.functions = new Functions(this);
this.commandLoader = new CommandLoader(this);
this.eventLoader = new EventLoader(this);
@ -41,7 +41,8 @@ class WoomyClient extends Discord.Client {
createEventListeners () {
this.on('ready', this.runReadyModules);
this.on('error', this.runErrorModules);
this.on('messageCreate', this.runMessageCreateModules);
this.on('interactionCreate', this.runInteractionModules);
/// this.on('messageCreate', this.runMessageCreateModules);
this.on('guildCreate', this.runGuildCreateModules);
this.on('guildDelete', this.runGuildDeleteModules);
this.on('guildMemberAdd', this.runGuildMemberAddModules);
@ -67,8 +68,11 @@ class WoomyClient extends Discord.Client {
this.mainEventListener('error', error);
}
runInteractionCreateModules (interaction) {
this.mainEventListener('interactionCreate', interaction);
}
runMessageCreateModules (message) {
this.messageHandler.handle(message);
this.mainEventListener('messageCreate', message);
}
@ -142,7 +146,7 @@ process.on('unhandledRejection', err => {
client.logger.error('UNHANDLED_PROMISE_ERROR', err.stack);
});
// Shut down gracefully when SIGINT is recieved
// Shut down gracefully when SIGINT is received
process.on('SIGINT', () => {
client.functions.shutdown();
});

View File

@ -18,7 +18,7 @@
"database": "",
"password": "",
"port": 0000
}
},
"emojis": {
"success": "<:success:466995111885144095>",