Reorder Index

This commit is contained in:
Daniel Odendahl Jr
2017-05-11 03:15:55 +00:00
parent 4796009bdf
commit 26c96e6d85
2 changed files with 21 additions and 19 deletions
+20 -18
View File
@@ -1,5 +1,4 @@
const { TOKEN, OWNER, PREFIX, INVITE, CLEVS_KEY, CLEVS_USER, CLEVS_NICK } = process.env;
const { CommandoClient } = require('discord.js-commando');
const client = new CommandoClient({
commandPrefix: PREFIX,
@@ -9,22 +8,18 @@ const client = new CommandoClient({
unknownCommandResponse: false
});
const path = require('path');
const { carbon, dBots } = require('./structures/Stats');
const SequelizeProvider = require('./providers/Sequelize');
const Database = require('./structures/PostgreSQL');
Database.start();
const Cleverbot = require('./structures/Cleverbot');
const clevs = new Cleverbot({
key: CLEVS_KEY,
user: CLEVS_USER,
nick: CLEVS_NICK
});
clevs.create();
let mention;
Database.start();
clevs.create();
client.setProvider(new SequelizeProvider(Database.db));
@@ -48,6 +43,24 @@ client.registry
.registerDefaultCommands({ help: false })
.registerCommandsIn(path.join(__dirname, 'commands'));
let mention;
client.on('ready', () => {
console.log(`[Ready] Shard ${client.shard.id} Logged in!`);
client.user.setGame(`x;help | Shard ${client.shard.id}`);
mention = new RegExp(`(<!?@${client.user.id}>)`, 'g');
});
client.on('disconnect', (event) => {
console.log(`[Disconnect] Shard ${client.shard.id} disconnected with Code ${event.code}.`);
process.exit(0);
});
client.on('error', console.error);
client.on('warn', console.warn);
client.on('commandError', (command, err) => console.error(command, err));
client.on('message', async (msg) => {
if (msg.author.bot) return;
if (msg.channel.type !== 'dm')
@@ -121,17 +134,6 @@ client.setTimeout(() => {
process.exit(0);
}, 14400000);
client.on('disconnect', (event) => {
console.log(`[Disconnect] Shard ${client.shard.id} disconnected with Code ${event.code}.`);
process.exit(0);
});
client.on('ready', () => {
console.log(`[Ready] Shard ${client.shard.id} Logged in!`);
client.user.setGame(`x;help | Shard ${client.shard.id}`);
mention = new RegExp(`(<!?@${client.user.id}>)`, 'g');
});
client.login(TOKEN);
process.on('unhandledRejection', console.error);
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "19.2.0",
"version": "19.2.1",
"description": "A Discord Bot",
"main": "shardingmanager.js",
"scripts": {