forked from vigneshd332/proximity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.js
31 lines (21 loc) · 789 Bytes
/
bot.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
//PACKAGES
const Discord = require('discord.js');
const Canvas = require('canvas');
const fs = require('fs');
const path = require('path')
//Fetches secret info from the environment variable
require('dotenv-flow').config();
//Global Variables
const Client = require('./struct/Client');
const client = new Client({ token: process.env.token, prefix: process.env.prefix, youtubeKey: process.env.youtubeKey , ownerID: process.env.ownerid});
//Initiates the Command and Event Handlers
fs.readdir('./Handlers/', (err, files) => {
if (err) return console.error(err)
files.forEach(file => {
const event = require(path.join(__dirname, "Handlers", file));
event.run(client);
})
});
//Logs into Client
client.login(client.config.token);
exports.client = client;