This repository was archived by the owner on Feb 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
76 lines (57 loc) · 2.57 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*====================================< IMPORT MODULES >====================================*/
const { Client, Collection } = require('discord.js');
const Manager = require("kazagumo");
const ShoukakuOptions = require("./Settings/ShoukakuOptions");
const Settings = require(`${process.cwd()}/Settings/Settings.json`);
const { readdirSync } = require("fs");
require("dotenv").config();
require("ms");
/*================================< CREATE DISCORD CLIENT >================================*/
const client = new Client({
shards: 'auto',
allowedMentions: {
parse: ['roles', 'users', 'everyone'],
repliedUser: false,
},
partials: ['MESSAGE', 'CHANNEL', 'REACTION'],
intents: 32767,
})
/*================================< DEPLOY [GUILD/GLOBAL] >================================*/
client.deploySlash = {
enabled: Settings.slashSettings.globalSlash,
guild: Settings.slashSettings.guildSlashOnly
};
/*=====================================< COLLECTIONS >=====================================*/
client.slashCommands = new Collection();
client.categories = new Collection();
client.cooldowns = new Collection();
client.commands = new Collection();
client.buttons = new Collection();
client.aliases = new Collection();
client.events = new Collection();
const { promisify } = require("util");
const { glob } = require("glob");
const globPromise = promisify(glob);
const AsciiTable = require("ascii-table");
/*====================================< MUSIC CLIENT >====================================*/
const NodeConfig = require("./Settings/LavalinkConfig");
client.manager;
const SpotifyCreds = {
spotify: {
clientId: process.env.SPOTIFY_ID,
clientSecret: process.env.SPOTIFY_SECRET
},
defaultSearchEngine: "youtube_music"
};
client.manager = new Manager(client, NodeConfig.nodes, ShoukakuOptions, SpotifyCreds);
// ==============================< MUSIC HANDLER >============================== //
require(`${process.cwd()}/Handlers/MusicSystem`)(client, globPromise, AsciiTable);
/*=======================================< HANDLERS >=======================================*/
["Events", "Commands", "SlashCommands", Settings.antiCrash ? "AntiCrash" : null]
.forEach(Handler => {
require(`${process.cwd()}/Handlers/${Handler}`)(client, globPromise, AsciiTable);
});
/*=======================================< DATABASE >=======================================*/
require(`${process.cwd()}/Database/Connect.js`);
/*=====================================< CLIENT LOGIN >=====================================*/
client.login(process.env.TOKEN);