Add files via upload
This commit is contained in:
6
bot/events/index.js
Normal file
6
bot/events/index.js
Normal file
@@ -0,0 +1,6 @@
|
||||
require('fs')
|
||||
.readdirSync(__dirname)
|
||||
.map(filename => {
|
||||
const moduleName = filename.split('.')[0];
|
||||
exports[moduleName] = require(`${__dirname}/${filename}`);
|
||||
});
|
||||
12
bot/events/messageCreate.js
Normal file
12
bot/events/messageCreate.js
Normal file
@@ -0,0 +1,12 @@
|
||||
async function messageCreate(msg) {
|
||||
if (!this.c.discordAdminIDs.includes(msg.author.id)) return;
|
||||
if (msg.content.indexOf(this.c.prefix) !== 0) return;
|
||||
const args = msg.content.slice(this.c.prefix.length).trim().split(/ +/g);
|
||||
const command = args.shift().toString().toLowerCase();
|
||||
for (let i = 0; this.commands.length > i; i++) {
|
||||
if (this.commands[i].command === command) {
|
||||
this.commands[i].execute(this, msg, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = messageCreate;
|
||||
5
bot/events/ready.js
Normal file
5
bot/events/ready.js
Normal file
@@ -0,0 +1,5 @@
|
||||
async function ready() {
|
||||
this.log.success('Discord API monitor successfully logged in');
|
||||
this.monitorChannel = this.c.discordChannelID;
|
||||
}
|
||||
module.exports = ready;
|
||||
Reference in New Issue
Block a user