2018-09-07 00:24:03 +02:00
|
|
|
const { CommandoClient } = require('discord.js-commando');
|
|
|
|
const path = require('path');
|
|
|
|
const { token } = require('./config.json');
|
2018-09-07 21:28:42 +02:00
|
|
|
const responseObject = require("./reply.json");
|
2018-09-07 00:24:03 +02:00
|
|
|
|
2018-09-07 21:28:42 +02:00
|
|
|
// Prefix and ownerID and invite to support server
|
2018-09-07 00:24:03 +02:00
|
|
|
const client = new CommandoClient({
|
2018-09-07 19:10:14 +02:00
|
|
|
commandPrefix: 'hehe ',
|
2018-09-07 19:07:10 +02:00
|
|
|
owner: '267065637183029248',
|
|
|
|
invite: 'https://discord.gg/SsMCsVY',
|
2018-09-07 00:24:03 +02:00
|
|
|
});
|
2018-09-07 21:28:42 +02:00
|
|
|
// Command groups
|
2018-09-07 00:24:03 +02:00
|
|
|
client.registry
|
2018-09-07 19:07:10 +02:00
|
|
|
.registerDefaultTypes()
|
|
|
|
.registerGroups([
|
|
|
|
['general', 'The most used commands'],
|
|
|
|
['admin', 'Commands to make admin life easier'],
|
|
|
|
['owner', 'Commands the owner can use to manage the bot'],
|
2018-09-07 21:28:42 +02:00
|
|
|
['fun', 'Fun commands'],
|
2018-09-07 19:07:10 +02:00
|
|
|
])
|
|
|
|
.registerDefaultGroups()
|
|
|
|
.registerDefaultCommands()
|
|
|
|
.registerCommandsIn(path.join(__dirname, 'commands'));
|
2018-09-07 21:28:42 +02:00
|
|
|
// Ready messages
|
2018-09-07 19:07:10 +02:00
|
|
|
client.on('ready', () => {
|
|
|
|
console.log(`Logged in as ${client.user.tag}! (${client.user.id})`);
|
|
|
|
console.log(`Ready to serve in ${client.channels.size} channels on ${client.guilds.size} servers, for a total of ${client.users.size} users.`);
|
|
|
|
client.user.setActivity('with nobody :(');
|
|
|
|
});
|
2018-09-07 21:28:42 +02:00
|
|
|
// Auto respond to messages
|
|
|
|
client.on("message", (message) => {
|
|
|
|
if(responseObject[message.content]) {
|
|
|
|
message.channel.send(responseObject[message.content]);
|
|
|
|
}
|
|
|
|
});
|
2018-09-07 19:07:10 +02:00
|
|
|
|
|
|
|
client.on('error', console.error);
|
2018-09-07 00:24:03 +02:00
|
|
|
|
2018-09-07 19:07:10 +02:00
|
|
|
client.login(token);
|