-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
33 lines (28 loc) · 1.06 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
// Documentation: https://discord.js.org/#/docs/discord.js/main/general/welcome
// Require the necessary discord.js classes
const { Client, Intents, Collection } = require('discord.js');
// Import data from config.json
const { prefix,guildid, clientid , BOT_TOKEN} = require('./config.json');
// require('dotenv').config();
// console.log(process.env)
// Create a new client instance, https://discord.js.org/#/docs/main/stable/class/Intents
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MEMBERS
]
});
// use promisify to convert callback into promise using utils, add table, glob
const {promisify} = require('util');
const { glob } = require('glob');
const PG = promisify(glob);
const Ascii = require('ascii-table');
// create collections
client.commands = new Collection();
// Handler import
["EventHandler","CommandHandler"].forEach(handler => {
require(`./Handlers/${handler}`)(client,PG,Ascii);
});
// Login to Discord with your client's token
client.login(BOT_TOKEN);