mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
32 lines
799 B
JavaScript
32 lines
799 B
JavaScript
/* eslint-disable max-len */
|
|
/* eslint-disable no-var */
|
|
/* eslint-disable prefer-rest-params */
|
|
/* eslint-disable no-tabs */
|
|
/* eslint-disable no-undef */
|
|
const config = require('./config');
|
|
const {createBot} = require('./bot');
|
|
const {
|
|
Client,
|
|
Intents,
|
|
} = require('discord.js');
|
|
const intents = new Intents(['GUILDS', 'GUILD_MESSAGES']);
|
|
const dcclient = new Client({
|
|
intents,
|
|
});
|
|
// readline > fix on console.log
|
|
// const log = console.log;
|
|
// console.log = function() {
|
|
// rl.output.write('\x1b[2K\r');
|
|
// log.apply(console, Array.prototype.slice.call(arguments));
|
|
// rl._refreshLine();
|
|
// };
|
|
|
|
const bots = [];
|
|
|
|
dcclient.on('ready', () => {
|
|
config.servers.forEach(async (server) => {
|
|
createBot(server, config, bots, dcclient);
|
|
});
|
|
});
|
|
|
|
dcclient.login(config.discord.token);
|