-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinsult.js
43 lines (42 loc) · 966 Bytes
/
insult.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
module.exports = function (Doorman) {
const insults = [
'you egg',
'you sandy bathing suit',
'you chunky carton of milk',
'you white crayon',
'you coatless eskimo',
'you wobbly chair leg',
'you armpit sweat stain',
'you unnecessary stock footage',
'you cup of cold creamerless coffee'
];
function resolveMention(usertxt) {
var userid = usertxt;
if (usertxt.startsWith('<@!')) {
userid = usertxt.substr(3, usertxt.length - 4);
} else {
if (usertxt.startsWith('<@')) {
userid = usertxt.substr(2, usertxt.length - 3);
}
}
return userid;
}
return {
commands: [
'insult'
],
'insult': {
usage: '<@mention>',
description: 'Insult someone (or everyone)',
process: (msg, suffix, isEdit, cb) => {
var randomnumber = Math.floor(Math.random() * (insults.length - 1 + 1)) + 1;
cb({
reply: resolveMention(suffix),
embed: {
description: insults[randomnumber]
}
}, msg);
}
}
}
}