This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
39 lines (33 loc) · 1.47 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
/* ____ ____ __ __ __ __ _
/ __ \____ _____ / __ )____ / /_ / / / /___ _____/ /_(_)___ ____ _
/ / / / __ `/ __ \/ __ / __ \/ __/ / /_/ / __ \/ ___/ __/ / __ \/ __ `/
/ /_/ / /_/ / / / / /_/ / /_/ / /_ / __ / /_/ (__ ) /_/ / / / / /_/ /
/_____/\__,_/_/ /_/_____/\____/\__/ /_/ /_/\____/____/\__/_/_/ /_/\__, /
Free Hosting for ever! /____/
*/
//Package Imports
global.Discord = require("discord.js");
global.client = new Discord.Client({ disableEveryone: true });
global.humanizeDuration = require('humanize-duration');
const db = require("quick.db");
global.axios = require("axios");
const fs = require("fs");
global.chalk = require("chalk");
//Custom pterodactyl modules
global.serverCreate = require('./utils/pterodactyl/createServer'); // Createserver module
global.serverCreate_n4 = require('./utils/pterodactyl/createServer-N4'); // Createserver module for Node 4 only
//Import config
global.config = require('./config.json')
//Create database for storing server settings
global.settings = new db.table('settings');
//Event handler
fs.readdir('./events/', (err, files) => {
files = files.filter(f => f.endsWith('.js'));
files.forEach(f => {
const event = require(`./events/${f}`);
client.on(f.split('.')[0], event.bind(null, client));
delete require.cache[require.resolve(`./events/${f}`)];
});
});
//Bot login
client.login(config.DiscordBot.Token);