Skip to content

Commit e46175b

Browse files
author
Claire Nord
committed
fun: eslint
1 parent 129e0e8 commit e46175b

1 file changed

Lines changed: 124 additions & 130 deletions

File tree

scripts/fun.js

Lines changed: 124 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -9,104 +9,103 @@
99
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
1010
*/
1111

12-
module.exports = function(robot) {
13-
robot.hear(/\s?#dev\b/, res => res.send("Did you mean #anish-talks-into-void?"));
12+
13+
module.exports = (robot) => {
14+
robot.hear(/\s?#dev\b/, (res) => res.send('Did you mean #anish-talks-into-void?'));
1415

1516
const fireballResponses = [
16-
"Under your couch",
17-
"In the middle of the Pacific ocean",
18-
"In Italy",
19-
"On the BART",
17+
'Under your couch',
18+
'In the middle of the Pacific ocean',
19+
'In Italy',
20+
'On the BART',
2021
"In Kimberli's supervisor's office",
21-
"Only Google knows...",
22-
"In Tel Aviv",
23-
"Ishaan has it",
24-
"I think Kimberli spilled it on her laptop",
25-
"Here: go/fireball"
22+
'Only Google knows...',
23+
'In Tel Aviv',
24+
'Ishaan has it',
25+
'I think Kimberli spilled it on her laptop',
26+
'Here: go/fireball',
2627
];
2728

28-
robot.hear(/where.*fireball/i, res => res.send(res.random(fireballResponses)));
29+
robot.hear(/where.*fireball/i, (res) => res.send(res.random(fireballResponses)));
30+
31+
const react = (emoji, res) => {
32+
if (robot.adapterName === 'slack') {
33+
return robot.emit('slack.reaction', {
34+
message: res.message,
35+
name: emoji,
36+
});
37+
}
38+
return res.send(`(react :${emoji}:)`);
39+
};
2940

3041
const lennySnakeParts = [
31-
"╚═( ͡° ͜ʖ ͡°)═╝",
32-
"╚═(███)═╝",
33-
"╚═(███)═╝",
34-
".╚═(███)═╝",
35-
"..╚═(███)═╝",
36-
"…╚═(███)═╝",
37-
"…╚═(███)═╝",
38-
"..╚═(███)═╝",
39-
".╚═(███)═╝",
40-
"╚═(███)═╝",
41-
".╚═(███)═╝",
42-
"..╚═(███)═╝",
43-
"…╚═(███)═╝",
44-
"…╚═(███)═╝",
45-
"…..╚(███)╝",
46-
"……╚(██)╝",
47-
"………(█)",
48-
"……….*"
42+
'╚═( ͡° ͜ʖ ͡°)═╝',
43+
'╚═(███)═╝',
44+
'╚═(███)═╝',
45+
'.╚═(███)═╝',
46+
'..╚═(███)═╝',
47+
'…╚═(███)═╝',
48+
'…╚═(███)═╝',
49+
'..╚═(███)═╝',
50+
'.╚═(███)═╝',
51+
'╚═(███)═╝',
52+
'.╚═(███)═╝',
53+
'..╚═(███)═╝',
54+
'…╚═(███)═╝',
55+
'…╚═(███)═╝',
56+
'…..╚(███)╝',
57+
'……╚(██)╝',
58+
'………(█)',
59+
'……….*',
4960
];
5061

5162
const lennySnakeTick = 300; // milliseconds
5263

53-
robot.hear(/lenny(snake|pede)/i, function(res) {
54-
var sendFrom = function(i) {
64+
robot.hear(/lenny(snake|pede)/i, (res) => {
65+
const sendFrom = (i) => {
5566
if (i < lennySnakeParts.length) {
5667
res.send(lennySnakeParts[i]);
57-
return setTimeout(sendFrom, lennySnakeTick, i + 1);
68+
setTimeout(sendFrom, lennySnakeTick, i + 1);
5869
}
5970
};
6071
return sendFrom(0);
6172
});
6273

63-
robot.hear(/jason/i, function(res) {
74+
robot.hear(/jason/i, (res) => {
6475
// make this less spammy
6576
if (Math.random() < 0.4) {
6677
if (Math.random() < 0.5) {
67-
return robot.emit("slack.reaction", {
68-
message: res.message,
69-
name: "upvote"
70-
});
78+
react('upvote', res);
7179
} else {
72-
return robot.emit("slack.reaction", {
73-
message: res.message,
74-
name: "no_wifi"
75-
});
80+
react('no_wifi', res);
7681
}
7782
}
7883
});
7984

80-
robot.hear(/fun/i, function(res) {
85+
robot.hear(/fun/i, (res) => {
8186
if (Math.random() < 0.3) {
82-
return robot.emit("slack.reaction", {
83-
message: res.message,
84-
name: "puzzled"
85-
});
87+
react('puzzled', res);
8688
}
8789
});
8890

89-
robot.hear(/michael/i, function(res) {
91+
robot.hear(/michael/i, (res) => {
9092
// make this less spammy
9193
if (Math.random() < 0.05) {
92-
return robot.emit("slack.reaction", {
93-
message: res.message,
94-
name: "silverman"
95-
});
94+
react('silverman', res);
9695
}
9796
});
9897

9998
// match basically any 100-char-long english sentence
100-
robot.hear(/e/i, function(res) {
99+
robot.hear(/e/i, (res) => {
101100
// make this less spammy
102101
if (res.message.text.length > 100 && Math.random() < 0.001) {
103-
return res.send("whoa whoa guys are we sure that's a good idea?");
102+
res.send("whoa whoa guys are we sure that's a good idea?");
104103
}
105104
});
106105

107-
robot.hear(/work/i, function(res) {
106+
robot.hear(/work/i, (res) => {
108107
if (res.message.text.length > 50 && Math.random() < 0.1) {
109-
return res.send("It's not work it's Datto");
108+
res.send("It's not work it's Datto");
110109
}
111110
});
112111

@@ -132,127 +131,122 @@ thank mr skeltal
132131
░░░░░█░░░░░░░░░░▐▌
133132
\`\`\``;
134133

135-
robot.hear(/(dootdootdoot|[0-9]spooky)/i, res => res.send(dootDoot));
134+
robot.hear(/(dootdootdoot|[0-9]spooky)/i, (res) => res.send(dootDoot));
136135

137-
robot.hear(/(^|\b)a+y+ l[mfao]+($|\b)/i, res => res.send(":alien: ayy lmao :alien:"));
136+
robot.hear(/(^|\b)a+y+ l[mfao]+($|\b)/i, (res) => res.send(':alien: ayy lmao :alien:'));
138137

139138
const troll = [
140-
"*Stef*: im in that class too",
141-
"*Stef*: omg me too",
142-
"*Stef*: ????? :chicken: :chicken: :chicken:",
143-
"*Stef*: I failed",
144-
"*Stef*: :pineapple: :pineapple: :pineapple:",
145-
"*Stef*: o rite jk I have to do 7.012 pset",
146-
"*Stef*: totally agree!!",
139+
'*Stef*: im in that class too',
140+
'*Stef*: omg me too',
141+
'*Stef*: ????? :chicken: :chicken: :chicken:',
142+
'*Stef*: I failed',
143+
'*Stef*: :pineapple: :pineapple: :pineapple:',
144+
'*Stef*: o rite jk I have to do 7.012 pset',
145+
'*Stef*: totally agree!!',
147146
"*Stef*: it's cuz I just add dropped",
148-
"*Stef*: I can prove it rigorously",
147+
'*Stef*: I can prove it rigorously',
149148
"*Stef*: wtf I'm in this group",
150-
"*Stef*: I luv genetics",
151-
"*Stef*: wtf that's what I was gonna say"
149+
'*Stef*: I luv genetics',
150+
"*Stef*: wtf that's what I was gonna say",
152151
];
153152

154-
robot.hear(/stef.*troll/i, res => res.send(res.random(troll)));
153+
robot.hear(/stef.*troll/i, (res) => res.send(res.random(troll)));
155154

156-
const more_troll = [
157-
"*Logan*: allllllllll right",
158-
"*Logan*: look who decided to show up",
159-
"*Logan*: big bois",
155+
const moreTroll = [
156+
'*Logan*: allllllllll right',
157+
'*Logan*: look who decided to show up',
158+
'*Logan*: big bois',
160159
"*Logan*: that's bananas",
161160
"*Logan*: it's lit",
162-
"*Logan*: not like this",
161+
'*Logan*: not like this',
163162
"*Logan*: that's fucked",
164-
"*Logan*: eecs eecs eecs eecs",
165-
"*Logan*: you dog",
166-
"*Logan*: that's pretty soft"
163+
'*Logan*: eecs eecs eecs eecs',
164+
'*Logan*: you dog',
165+
"*Logan*: that's pretty soft",
167166
];
168167

169-
robot.hear(/logan.*troll/i, res => res.send(res.random(more_troll)));
168+
robot.hear(/logan.*troll/i, (res) => res.send(res.random(moreTroll)));
170169

171170
const pusheens = [
172-
"http://i.imgur.com/ozA8GSu.png",
173-
"http://i.imgur.com/ZKQc2Zr.png",
174-
"http://i.imgur.com/4kYoLqW.png",
175-
"http://i.imgur.com/RrLH94y.png",
176-
"http://i.imgur.com/frlzb8j.png",
177-
"http://i.imgur.com/CrlTN9g.png",
178-
"http://i.imgur.com/T3aU0jE.png",
179-
"http://i.imgur.com/WVNB0AI.png",
180-
"http://i.imgur.com/MgURast.png",
181-
"http://i.imgur.com/h0WeeGt.png",
182-
"http://i.imgur.com/5Gaquu2.png",
183-
"http://i.imgur.com/KBRkat2.png",
184-
"http://i.imgur.com/2DA3pUj.png",
185-
"http://i.imgur.com/zbkwKyo.png",
186-
"http://i.imgur.com/ZjxGDGu.png",
187-
"http://i.imgur.com/2fM3Llu.png",
188-
"http://i.imgur.com/vmBTVZT.png",
189-
"http://i.imgur.com/LM4RhiD.png",
190-
"http://i.imgur.com/GsA3vF8.png",
191-
"http://i.imgur.com/SRlVsQl.png"
171+
'http://i.imgur.com/ozA8GSu.png',
172+
'http://i.imgur.com/ZKQc2Zr.png',
173+
'http://i.imgur.com/4kYoLqW.png',
174+
'http://i.imgur.com/RrLH94y.png',
175+
'http://i.imgur.com/frlzb8j.png',
176+
'http://i.imgur.com/CrlTN9g.png',
177+
'http://i.imgur.com/T3aU0jE.png',
178+
'http://i.imgur.com/WVNB0AI.png',
179+
'http://i.imgur.com/MgURast.png',
180+
'http://i.imgur.com/h0WeeGt.png',
181+
'http://i.imgur.com/5Gaquu2.png',
182+
'http://i.imgur.com/KBRkat2.png',
183+
'http://i.imgur.com/2DA3pUj.png',
184+
'http://i.imgur.com/zbkwKyo.png',
185+
'http://i.imgur.com/ZjxGDGu.png',
186+
'http://i.imgur.com/2fM3Llu.png',
187+
'http://i.imgur.com/vmBTVZT.png',
188+
'http://i.imgur.com/LM4RhiD.png',
189+
'http://i.imgur.com/GsA3vF8.png',
190+
'http://i.imgur.com/SRlVsQl.png',
192191
];
193192

194-
robot.hear(/pusheen/i, res => res.send(res.random(pusheens)));
193+
robot.hear(/pusheen/i, (res) => res.send(res.random(pusheens)));
195194

196-
robot.hear(/kim.*mom/i, res =>
197-
res.send("https://answers.yahoo.com/question/index?qid=20100404125550AARFOJe")
198-
);
195+
robot.hear(/kim.*mom/i, (res) => res.send('https://answers.yahoo.com/question/index?qid=20100404125550AARFOJe'));
199196

200-
robot.hear(/stef/i, function(res) {
197+
robot.hear(/stef/i, (res) => {
201198
if (Math.random() < 0.01) {
202-
return res.send(res.random(troll));
199+
res.send(res.random(troll));
203200
}
204201
});
205202

206-
robot.hear(/logan/i, function(res) {
203+
robot.hear(/logan/i, (res) => {
207204
if (Math.random() < 0.01) {
208-
return res.send(res.random(more_troll));
205+
res.send(res.random(moreTroll));
209206
}
210207
});
211208

212-
robot.hear(/\btfti\b/, function(res) {
209+
robot.hear(/\btfti\b/, (res) => {
213210
if (Math.random() < 0.2) {
214-
return res.send("tfti");
211+
res.send('tfti');
215212
}
216213
});
217214

218-
robot.hear(/^same$/, function(res) {
215+
robot.hear(/^same$/, (res) => {
219216
if (Math.random() < 0.4) {
220-
return res.send("same");
217+
res.send('same');
221218
}
222219
});
223220

224-
robot.respond(/correct (.*)/, function(res) {
221+
robot.respond(/correct (.*)/, (res) => {
225222
const msg = res.match[1];
226-
return res.send(msg.replace(/[aeiou]/gi, ""));
223+
return res.send(msg.replace(/[aeiou]/gi, ''));
227224
});
228225

229226
const selfDestructSequence = [
230-
"Initiating HackMIT self-destruct sequence...",
231-
"10: Leaking sponsorship info...",
232-
"9: Insulting all previous company contacts...",
233-
"8: Transferring funds to FCF...",
234-
"7",
235-
"6: Destroying all AWS instances...",
236-
"5: ",
237-
"4: Petting Oscar...",
238-
"3",
239-
"2",
227+
'Initiating HackMIT self-destruct sequence...',
228+
'10: Leaking sponsorship info...',
229+
'9: Insulting all previous company contacts...',
230+
'8: Transferring funds to FCF...',
231+
'7',
232+
'6: Destroying all AWS instances...',
233+
'5: ',
234+
'4: Petting Oscar...',
235+
'3',
236+
'2',
240237
"1: You've met with a terrible fate, haven't you?",
241-
"http://rs651.pbsrc.com/albums/uu236/416o/explosion.gif~c200"
238+
'http://rs651.pbsrc.com/albums/uu236/416o/explosion.gif~c200',
242239
];
243240

244-
const selfDestructTick = 1000; //milliseconds
241+
const selfDestructTick = 1000; // milliseconds
245242

246-
return robot.respond(/selfdestruct/i, function(res) {
247-
var sendFrom = function(i) {
243+
return robot.respond(/selfdestruct/i, (res) => {
244+
const sendFrom = (i) => {
248245
if (i < selfDestructSequence.length) {
249246
res.send(selfDestructSequence[i]);
250-
return setTimeout(sendFrom, selfDestructTick, i + 1);
247+
setTimeout(sendFrom, selfDestructTick, i + 1);
251248
}
252249
};
253250
return sendFrom(0);
254251
});
255252
};
256-
257-
// robot.hear /retreat/i, (res) ->
258-
// res.send 'Did you mean: *kickoff*?'

0 commit comments

Comments
 (0)