Compare commits

..

No commits in common. "dfc1674bad56bbb6c9072369db071f06b5586b8f" and "acba68a2d1c79909e26e1db077116f3e00c6e540" have entirely different histories.

7 changed files with 9 additions and 13 deletions

View file

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

View file

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

0
bot/util/dbvalidator.js Normal file
View file

View file

View file

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