Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions scripts/cute.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Cute bomb is the cutest script
//Commands:
// fred cute me
// fred cute bomb
// fred cute bomb N

module.exports = function(robot){
Expand All @@ -15,7 +14,9 @@ module.exports = function(robot){
return;
}

msg.send( (JSON.parse(body).data.children)[Math.floor(Math.random()*(JSON.parse(body).data.children).length)].data.url);
var json = JSON.parse(body).data.children;

msg.send( json[random].data.url);
});

});
Expand All @@ -31,8 +32,15 @@ module.exports = function(robot){
return;
}

var json = JSON.parse(body).data.children;


for(var i = 0; i < count; i++){
msg.send( (JSON.parse(body).data.children)[Math.floor(Math.random()*(JSON.parse(body).data.children).length)].data.url);
var random = Math.floor(Math.random()*json.length);
msg.send( json[random].data.url);
if(json.length > 1){
json.splice(random, 1);
}
}
});
});
Expand Down
16 changes: 16 additions & 0 deletions scripts/fingerguns.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//Description:
// Responds with some rad fingerguns.
//Commands:
// fred fingerguns

module.exports = function(robot){

let emoticons = ['(☞ ͡° ͜ʖ ͡°)☞','(σ゚ロ゚)σ','(╭☞• ⍛• )╭☞','(╭☞•̀o•́)╭☞','( ☞◔ ౪◔)☞','╭☞(-_-)╭☞'];

robot.respond(/fingerguns/i, function(msg){

let randomEmoticon = emoticons[Math.floor((Math.random() * emoticons.length))];
msg.send(randomEmoticon);

});
}