-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhb.js
43 lines (34 loc) · 979 Bytes
/
hb.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
irc = require('irc');
var phrase1 = "don't care";
var phrase2 = "don't give a fuck";
var irc_server = "irc.freenode.net";
var channel = "#modilabs";
var nick = "honey_badger";
function random_say(one,two) {
var rand = Math.random();
if (rand > 0.5) {
return one;
}else{
return two;
}
};
var bot = new irc.Client(irc_server, nick, {
debug:false,
channels:[channel],
realName: "James Joyce",
});
bot.addListener('error', function(message) {
console.error('ERROR: %s: %s', message.command, message.args.join(' '));
});
bot.addListener('message', function (from, to, message) {
if (message.match(/honey_badger/)) {
bot.say(channel,random_say(phrase1, phrase2));
}
if (to==nick) {
bot.say(from,random_say(phrase1,phrase2));
}
if (message.match(/^attack/)) {
var temp_nick = message.split("attack ")[1]
bot.say(channel, "Tears "+temp_nick+"'s intestine out, yummy")
}
});