forked from EntasiaOfficiel/Discord_Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
59 lines (48 loc) · 1.71 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
const { Client } = require('discord.js')
config = require('entasia/config')
bot = new Client({ allowedMentions: {parse:["users"]}, disableMentions: "everyone" })
bot.login(require("entasia/pass").token)
.catch((err)=>{throw err});
if(config.dev){
socket = {}
socket.listen = ()=>{}
}else socket = require('entasia/Socket')
functions = require('entasia/GlobalAPI').functions
databases = require('entasia/Databases')
CustomEmbed = require('entasia/CustomEmbed')
vars = {}
vars.onlines = {}
vars.totalonlines = []
logger("Démarrage du bot..")
bot.on("ready", async function(){
logger("Bot connecté !")
logger("Nom : "+bot.user.tag)
logger("Activation des fonctionnalités..")
config.entasia = bot.guilds.cache.get(config.entasia)
config.owner = bot.users.cache.get(config.owner)
for(let [k, v] of bot.guilds.cache){
if(k!=config.entasia.id){
logger("Discord "+v.name+" quitté")
v.leave()
}
}
for(let i in config.channels){
config.channels[i] = config.entasia.channels.cache.get(config.channels[i])
if(!config.channels[i])logger("Erreur lors de la récupération de "+i+" !")
}
for(let i in config.roles){
config.roles[i] = config.entasia.roles.cache.get(config.roles[i])
if(!config.roles[i])logger("Erreur lors de la récupération de "+i+" !")
}
for(let i in config.emojis){
config.emojis[i] = config.entasia.emojis.cache.get(config.emojis[i])
if(!config.emojis[i])logger("Erreur lors de la récupération de "+i+" !")
}
for(let i in config.roles_reacts){
config.roles_reacts[i] = config.entasia.roles.cache.get(config.roles_reacts[i])
if(!config.roles_reacts[i])logger("Erreur lors de la récupération de "+i+" !")
}
require('./Commands/Commands')
require('./Features')
logger("Fini !")
})