-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex-bot.js
More file actions
43 lines (31 loc) · 1.19 KB
/
index-bot.js
File metadata and controls
43 lines (31 loc) · 1.19 KB
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
const Discord = require('discord.js');
const SnoCord = require('snocord');
const SnoDB = require('snodb');
const config = require('./config.json');
const CleverResponse = require('./src-bot/modules/CleverResponse.js');
const ytf = require('./src-bot/modules/YouTubeEmbedFixer.js');
const readyEvent = require('./events/ready.js');
let bot;
function run(ver){
bot = new SnoCord.Bot();
bot.setConfig(config);
bot.addCoreCommands();
bot.addCommandHandler('./src-bot/commands/');
let presence = ""
if(ver.branch == "dev")
presence += "[DEV] ";
presence += `snobot.xyz | v${ver.num}.${ver.build}`;
bot.setPresence({ activity: { name: presence }, status: 'online' });
bot.addCustomResponse(new CleverResponse(bot));
bot.client.youTubeEmbedFixer = new ytf((ver.branch == "dev"))
bot.client.ver = ver;
bot.client.config = bot.config;
bot.client.on('message', (message)=>bot.client.youTubeEmbedFixer.runFix(message));
bot.client.on('ready', ()=>{readyEvent(bot.client)})
bot.init();
bot.client.options.disableMentions = 'everyone';
};
function getBot(){
return bot;
}
module.exports = {run, getBot};