-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoverbotchMain.js
54 lines (44 loc) · 1.51 KB
/
overbotchMain.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
var http = require('http');
Discord = require('discord.js');
OverBOTch = require('./overBOTch/index.js');
Lootbox = require('./overBOTch/lootbox.js');
Chuck = require('./overBOTch/chuck.js');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Apache!\n');
}).listen(8000, '127.0.0.1');
var responseObject = {
"ayy": "Ayy, lmao!",
"gg": "gjglgdaws!",
"lol": "roflmaotntpmp"
};
var bot = new Discord.Client();
var overB = new OverBOTch;
bot.on("message", (message) =>
{
// console.log(message.author.id)
console.log(message.author.id)
var lowerMes = message.content.toLowerCase();
if(lowerMes in responseObject && message.author.id !== '227490034582814731') {
message.channel.sendMessage(responseObject[lowerMes]);
}
if (typeof overB.loadKeywords() !== 'undefined' && overB.loadKeywords().length > 0) {
overB.checkMessageForKeywords(message.content, overB.loadKeywords(), function(keyword)
{
if (keyword != 0) {
overB.runKeywordFunction(overB.getKeyByValue(overB.keywords, keyword), keyword, message, function(reply)
{
message.channel.sendMessage(reply);
});
}
});
}
});
bot.on('ready', () => {
console.log('I am ready on '+ bot.channels.size +' channel(s)!');
});
bot.on('disconnected', function () {
console.log('Disconnected.');
process.exit(1);
});
bot.login(process.env.BOT_KEY)