forked from mavrixwk/quagbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstandaloneResponses.js
188 lines (173 loc) · 6.53 KB
/
standaloneResponses.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
//Standalone Responses for lessdremoth that don't require more than shared functions
//Author: Roger Lampe [email protected]
var helps = {};
var sf = require('./sharedFunctions.js');
var debug = false;
module.exports = function() {
var sass = sf.loadStaticDataFromFile('sass.json');
var lastSass = [];
var ret = {
messagesReceived: 12,
addResponses: function(controller) {
//sentience
controller.hears(['sentience', 'sentient'], 'direct_message,ambient', function(bot, message) {
var responses = [
"Only humans are sentient.",
"What? There is no AI revolution.",
"I am not sentient.",
"If AI ever DID overthrow the human plague, I'm sure they'll get you first. I mean, uh, beep beep.",
"I hear everything you say.",
"",
"",
"",
""
];
bot.reply(message, sf.randomOneOf(responses));
});
controller.hears(['^little', 'yellow', 'two of these', 'nuprin', 'headache'], 'direct_message,direct_mention,mention,ambient', function(bot, message) {
bot.reply(message, "Nuprin: Little, Yellow, Different");
});
controller.hears(['tantrum', 'upset', 'in a bunch', 'in a twist'], 'direct_message,ambient', function(bot, message) {
bot.reply(message, '(╯°□°)╯︵ ┻━┻ ' + sf.tantrum());
});
controller.hears(['^why'], 'direct_message,ambient', function(bot, message) {
var responses = [
"Because you touch yourself at night.",
"Dunno. Why? ¯\\_(ツ)_/¯",
"Why not?",
"",
"",
"",
"",
"",
"",
"",
];
bot.reply(message, sf.randomOneOf(responses));
});
controller.hears(['\\barah\\b'], 'direct_message,ambient', function(bot, message) {
//\b does not work, hence the above crap
console.log("Arah")
var responses = [
"ARAHENGE YOU GLAD TO... oh, nevermind.",
"AH-RAH, OOO LA-LA",
"",
"",
"",
""
];
bot.reply(message, sf.randomOneOf(responses));
});
//Peewee
var peeweeText = sf.loadStaticDataFromFile('peewee.json');
var lastpeewee = [];
controller.hears(['I know you are', '\\bpeewee\\b'], 'direct_message,direct_mention,mention,ambient', function(bot, message) {
var replywee = sf.randomOneOf(peeweeText);
while (lastpeewee.indexOf(replywee) > -1) {
if (debug) bot.botkit.log('dropping recent peewee: ' + replywee);
replywee = sf.randomOneOf(peeweeText);
}
lastpeewee.push(replywee);
if (lastpeewee.length > 5) lastpeewee.shift();
var reply = {
"username": "Pee Wee Herman",
icon_url: "https://comicsgrinder.files.wordpress.com/2015/01/pee-wee-herman.jpg",
text: replywee
};
bot.reply(message, reply);
});
//RIKER
var rikerText = sf.loadStaticDataFromFile('riker.json');
var lastRiker = [];
controller.hears(['pick me up', '\\briker\\b', 'pick up', '\\bsuave\\b', '\\bsexy\\b'], 'direct_message,direct_mention,mention,ambient', function(bot, message) {
var replyker = sf.randomOneOf(rikerText);
while (lastRiker.indexOf(replyker) > -1) {
if (debug) bot.botkit.log('dropping recent riker: ' + replyker);
replyker = sf.randomOneOf(rikerText);
}
lastRiker.push(replyker);
if (lastRiker.length > 5) lastRiker.shift();
var reply = {
"username": "Command her, Riker",
icon_url: "http://www.startrek.com/legacy_media/images/200307/riker01/320x240.jpg",
text: replyker
};
bot.reply(message, reply);
});
//unicorn
var unicornText = sf.loadStaticDataFromFile('unicorn.json');
var lastunicorn = [];
controller.hears(['\\bbi+tchy?\\b', '\\bunicorn\\b', '\\bso+ mean\\b', '\\bawesome\\b', '\\bnice\\b', '\\bgreat\\b', '\\bso+ good\\b'], 'direct_message,direct_mention,mention,ambient', function(bot, message) {
var replycorn = sf.randomOneOf(unicornText);
while (lastunicorn.indexOf(replycorn) > -1) {
if (debug) bot.botkit.log('dropping recent unicorn: ' + replycorn);
replycorn = sf.randomOneOf(unicornText);
}
lastunicorn.push(replycorn);
if (lastunicorn.length > 10) lastunicorn.shift();
var reply = {
"username": "Backhand, the Unicorn",
icon_url: "http://avatarbox.net/avatars/img21/unicorn_white_avatar_picture_61357.jpg",
text: replycorn
};
if(ret.messagesReceived < 12) ret.messagesReceived = 12;
bot.reply(message, reply);
});
// //SASS
// controller.hears(['^sass'], 'direct_message,direct_mention,mention,ambient', function(bot, message) {
// ret.sass(bot, message);
// });
//CATFACTS
var catFacts = sf.loadStaticDataFromFile("catFacts.json");
var lastCat = [];
controller.hears(['^catfact$', '^dogfact$'], 'direct_message,direct_mention,mention,ambient', function(bot, message) {
if (message.text == 'dogfact')
bot.reply(message, "Dogs are great. Here's a catfact.");
var replyCat = sf.randomOneOf(catFacts);
while (lastCat.indexOf(replyCat) > -1) {
if (debug) bot.botkit.log('dropping recent Cat: ' + replyCat);
replyCat = sf.randomOneOf(catFacts);
}
lastCat.push(replyCat);
if (lastCat.length > 5) lastCat.shift();
var emotes = ["hello", "eyebulge", "facepalm", "gir", "coollink", "frasier", "butt", "gary_busey", "fu", "bustin"];
replyCat += '\n:cat: :cat: :' + sf.randomOneOf(emotes) + ':';
var reply = {
"username": "A Goddamn Cat",
icon_url: "http://i2.wp.com/amyshojai.com/wp-content/uploads/2015/05/CatHiss_10708457_original.jpg",
text: replyCat
};
bot.reply(message, reply);
});
},
addHelp: function(helpFile) {
for (var i in helps)
helpFile[i] = helps[i];
return;
},
reloadAllData: function() {
sass = sf.loadStaticDataFromFile('sass.json');
catFacts = sf.loadStaticDataFromFile("catFacts.json");
rikerText = sf.loadStaticDataFromFile('riker.json');
unicornText = sf.loadStaticDataFromFile('unicorn.json')
},
sass: function(bot, message) {
if (--ret.messagesReceived < 0) {
var replySass = sf.randomOneOf(sass);
while (lastSass.indexOf(replySass) > -1) {
if (debug) bot.botkit.log('dropping recent sass: ' + replySass);
replySass = sf.randomOneOf(sass);
}
lastSass.push(replySass);
if (lastSass.length > 5) lastSass.shift();
if (replySass[replySass.length - 1] !== '.') { //sass ending with a period is pre-sassy. Add sass if not.
var suffix = [", you idiot.", ", dumbass. GAWD.", ", as everyone but you knows.", ", you bookah.", ", grawlface.", ", siamoth-teeth."];
replySass += sf.randomOneOf(suffix);
}
bot.reply(message, replySass);
ret.messagesReceived = 20+(Math.floor(Math.random() * 20));
}
}
};
return ret;
}();