-
Notifications
You must be signed in to change notification settings - Fork 0
/
geralt.js
38 lines (30 loc) · 1.17 KB
/
geralt.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
(function() { // IIFE starts
$.bind('command', function(event) {
var command = event.getCommand();
var sender = event.getSender();
var arguments = event.getArguments();
var args = event.getArgs();
var quoteList = [
"Medallion's humming, a place of power gotta be. Should draw from it.",
"Wanna hear a limerick? Lambert, Lambert, what a prick.",
"How do you like that silver?",
"Looks like rain.",
"I hate portals.",
"How about a round of Gwent?",
"Wind's howling."
];
// command !geralt
if (command.equalsIgnoreCase('geralt')) {
// Math.random(): inclusive of 0, but not 1
var selectedIdx = Math.floor(Math.random() * quoteList.length);
var message = quoteList[selectedIdx];
// send messages to Twitch chat
$.say(message);
}
});
$.bind('initReady', function() {
$.registerChatCommand('./biubot/geralt.js', // script location
'geralt', // command
7); // permission
});
})(); // IIFE ends