mirror of
https://github.com/reality/dbot.git
synced 2024-12-02 17:09:29 +01:00
present for roi
This commit is contained in:
parent
64fdca5097
commit
46de1a5fac
@ -167,6 +167,28 @@ var imgur = function(dbot) {
|
|||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'~sri': function(event) {
|
||||||
|
var local = event.user;
|
||||||
|
if(event.params[1]) {
|
||||||
|
local = event.params.splice(1, event.params.length - 1).join(' ').trim();
|
||||||
|
}
|
||||||
|
request.get({
|
||||||
|
'url': this.ApiRoot + 'gallery/random/random/',
|
||||||
|
'json': true,
|
||||||
|
'headers': {
|
||||||
|
'Authorization': 'Client-ID ' + this.config.apikey
|
||||||
|
}
|
||||||
|
}, function(err, response, body) {
|
||||||
|
if(body.data && body.data[0] != undefined) {
|
||||||
|
var num = _.random(0, body.data.length - 1);
|
||||||
|
this.api.getGalleryInfo(body.data[num].id, function(gal) {
|
||||||
|
event.reply(local + ': ' + gal.data.link + ' [' +
|
||||||
|
this.internalAPI.galleryInfoString(gal) + ']');
|
||||||
|
}.bind(this));
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
|
},
|
||||||
|
|
||||||
'~imgur': function(event) {
|
'~imgur': function(event) {
|
||||||
var term = event.input[1];
|
var term = event.input[1];
|
||||||
request.get({
|
request.get({
|
||||||
|
Loading…
Reference in New Issue
Block a user