forked from ZerioDev/Music-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
40 lines (30 loc) · 1004 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
35
36
37
38
39
40
require('dotenv').config()
const { Player } = require('discord-player')
const { Client, GatewayIntentBits } = require('discord.js')
const { alea_hex } = require('./src/functions/hex_color')
const { getUser } = require('./src/database/schemas/User')
const database = require('./src/database/database')
global.client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.MessageContent
],
disableMentions: 'everyone',
})
client.config = require('./config')
client.getUser = (id_user) => {
return getUser(id_user)
}
client.embed_color = (entrada) => {
if (entrada === "RANDOM")
return alea_hex()
return entrada.slice(-6)
}
global.player = new Player(client, client.config.opt.discordPlayer)
require('./src/loader')
require('./src/events')
database.setup(process.env.url_dburi)
client.login(process.env.token)