-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
44 lines (35 loc) · 980 Bytes
/
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
//INIT
//Node Modules
require('app-module-path').addPath(__dirname);
const Discord = require('discord.js');
//Config
const config = require("./config");
//Components
const Args = require('./components/args');
const Commands = require('./components/commands')
//Constants
const botName = 'Alice';
const modulesFolder = 'modules';
//Bot attributes
bot = new Discord.Client();
bot.modules = new Discord.Collection();
bot.prefix = '.';
bot.moduleFile = 'module.js'
bot.utilFolder = 'utils'
//Components instancing
bot.commandManager = new Commands(Discord,modulesFolder,bot);
bot.args = new Args(bot,Discord);
//ENDINIT
//BOT START//
bot.login(config.botId);
bot.on('ready', function(){
console.log("Initialisation starting...");
bot.commandManager.load_commands();
console.log("All commands loaded");
bot.user.setActivity(bot.prefix + 'help');
console.log(botName + " is now on.");
})
bot.on('message',(msg) => {
bot.args.checkForCommands(msg);
})
//