3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 14:29:29 +01:00

~squestion

This commit is contained in:
reality 2014-07-22 11:33:36 +00:00
parent 48ba900ea1
commit 30ffd22599

View File

@ -174,6 +174,15 @@ var reddit = function(dbot) {
});
},
'~squestion': function(event) {
this.api.getNewPosts('askscience', 0, function(err, posts) {
if(!err) {
var qPost = posts[_.random(0, posts.length - 1)];
event.reply('Question: ' + qPost.title.trim());
}
});
},
'~addredditfeed': function(event) {
var channel = event.input[1],
subreddit = event.input[2].replace('r/', ''),