mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 08:12:04 +02:00
Reorder Index
This commit is contained in:
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "19.2.0",
|
||||
"version": "19.2.1",
|
||||
"description": "A Discord Bot",
|
||||
"main": "shardingmanager.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user