-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
49 lines (40 loc) · 1.72 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require('events').EventEmitter.defaultMaxListeners = 50;
// Path aliases
require('module-alias/register')
// New client
const Discord = require('discord.js')
const client = new Discord.Client()
// Load commands and get version
const loadYAML = require('@modules/yaml.js')
const config = loadYAML('config')
const loadCommands = require('@root/commands/load-commands')
const loadFeatures = require('@root/features/load-features')
const { version } = require('@root/package.json')
// Env
require('dotenv').config();
const token = process.env.DISCORD_TOKEN
// Chalk
const chalk = require('chalk');
const infoPrefixColor = chalk.black.bgWhite
const warnPrefixColor = chalk.black.bgYellow
const errorPrefixColor = chalk.white.bgRed
const urlColor = chalk.blue.underline
const highlightColor = chalk.yellow
client.on('ready', async () => {
// Console startup messages
console.log(infoPrefixColor(config.ConsoleStyle.Prefix.Info), `Loged on as ` + highlightColor(`${client.user.tag}`) + ` in ` + highlightColor(`${client.guilds.cache.size}`) + ` server(s) at ` + highlightColor(`${client.readyAt}`) + `.`);
console.log(infoPrefixColor(config.ConsoleStyle.Prefix.Info), `Bot created by ` + highlightColor(`FrenchBones`) + ` ` + urlColor(`(https://frenchbones.net)`) + `. Read the Code Of Conduct. This bot is not for reselling.`)
console.log(infoPrefixColor(config.ConsoleStyle.Prefix.Info), `Bot version:`, highlightColor(version), `\n`)
// Status - will soon switch to a database so that the bot remebers
client.user.setPresence({
status: `dnd`,
activity: {
name: `commands`,
type: `LISTENING`
}
});
loadCommands(client)
loadFeatures(client)
})
// Bot login
client.login(token);