-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
main.js
34 lines (27 loc) · 984 Bytes
/
main.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
require('dotenv').config()
const { Player } = require('discord-player');
const { Client, GatewayIntentBits } = require('discord.js');
global.client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.MessageContent
],
disableMentions: 'everyone',
});
client.config = require('./config');
const player = new Player(client, client.config.opt.discordPlayer);
player.extractors.loadDefault();
console.clear()
require('./loader');
client.login(client.config.app.token)
.catch(async (e) => {
if(e.message === 'An invalid token was provided.'){
require('./process_tools')
.throwConfigError('app', 'token', '\n\t ❌ Invalid Token Provided! ❌ \n\tchange the token in the config file\n')}
else{
console.error('❌ An error occurred while trying to login to the bot! ❌ \n', e)
}
});