mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +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 { TOKEN, OWNER, PREFIX, INVITE, CLEVS_KEY, CLEVS_USER, CLEVS_NICK } = process.env;
|
||||||
|
|
||||||
const { CommandoClient } = require('discord.js-commando');
|
const { CommandoClient } = require('discord.js-commando');
|
||||||
const client = new CommandoClient({
|
const client = new CommandoClient({
|
||||||
commandPrefix: PREFIX,
|
commandPrefix: PREFIX,
|
||||||
@@ -9,22 +8,18 @@ const client = new CommandoClient({
|
|||||||
unknownCommandResponse: false
|
unknownCommandResponse: false
|
||||||
});
|
});
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
const { carbon, dBots } = require('./structures/Stats');
|
const { carbon, dBots } = require('./structures/Stats');
|
||||||
|
|
||||||
const SequelizeProvider = require('./providers/Sequelize');
|
const SequelizeProvider = require('./providers/Sequelize');
|
||||||
const Database = require('./structures/PostgreSQL');
|
const Database = require('./structures/PostgreSQL');
|
||||||
Database.start();
|
|
||||||
|
|
||||||
const Cleverbot = require('./structures/Cleverbot');
|
const Cleverbot = require('./structures/Cleverbot');
|
||||||
const clevs = new Cleverbot({
|
const clevs = new Cleverbot({
|
||||||
key: CLEVS_KEY,
|
key: CLEVS_KEY,
|
||||||
user: CLEVS_USER,
|
user: CLEVS_USER,
|
||||||
nick: CLEVS_NICK
|
nick: CLEVS_NICK
|
||||||
});
|
});
|
||||||
clevs.create();
|
|
||||||
|
|
||||||
let mention;
|
Database.start();
|
||||||
|
clevs.create();
|
||||||
|
|
||||||
client.setProvider(new SequelizeProvider(Database.db));
|
client.setProvider(new SequelizeProvider(Database.db));
|
||||||
|
|
||||||
@@ -48,6 +43,24 @@ client.registry
|
|||||||
.registerDefaultCommands({ help: false })
|
.registerDefaultCommands({ help: false })
|
||||||
.registerCommandsIn(path.join(__dirname, 'commands'));
|
.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) => {
|
client.on('message', async (msg) => {
|
||||||
if (msg.author.bot) return;
|
if (msg.author.bot) return;
|
||||||
if (msg.channel.type !== 'dm')
|
if (msg.channel.type !== 'dm')
|
||||||
@@ -121,17 +134,6 @@ client.setTimeout(() => {
|
|||||||
process.exit(0);
|
process.exit(0);
|
||||||
}, 14400000);
|
}, 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);
|
client.login(TOKEN);
|
||||||
|
|
||||||
process.on('unhandledRejection', console.error);
|
process.on('unhandledRejection', console.error);
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaobot",
|
"name": "xiaobot",
|
||||||
"version": "19.2.0",
|
"version": "19.2.1",
|
||||||
"description": "A Discord Bot",
|
"description": "A Discord Bot",
|
||||||
"main": "shardingmanager.js",
|
"main": "shardingmanager.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user