first commit probably lots of errors
This commit is contained in:
commit
ec94c2080b
99 changed files with 10227 additions and 0 deletions
22
src/applications/bot.js
Normal file
22
src/applications/bot.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* licence https://github.com/404invalid-user/knightrider/blob/main/LICENCE
|
||||
*/
|
||||
const chalk = require('chalk')
|
||||
const { readdirSync } = require('fs')
|
||||
const Discord = require('discord.js')
|
||||
module.exports = (client, webServer) => {
|
||||
|
||||
client.commands = new Discord.Collection();
|
||||
client.addons = [];
|
||||
const handlers = readdirSync(__dirname + '/../bot/handlers/').filter((file) => file.endsWith(".js"));
|
||||
for (let handler of handlers) {
|
||||
require(`../bot/handlers/${handler}`)(client);
|
||||
}
|
||||
|
||||
try {
|
||||
client.login(require('../conf/tokens').bot.token);
|
||||
} catch (error) {
|
||||
console.log(chalk.blue('[bot]: ') + chalk.red('(error): ') + "cant login error: " + error);
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue