3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 14:29:29 +01:00
This commit is contained in:
reality 2015-01-24 17:34:30 +00:00
parent a101cfe437
commit ff342bc932

View File

@ -46,14 +46,11 @@ var github = function(dbot) {
} }
// TODO: move this shizz into an api call // TODO: move this shizz into an api call
var longurl = "http://github.com/" + repo; var longurl = "http://github.com/" + repo;
request({method: 'POST', uri: 'http://git.io', form:{url: longurl}}, function(error, response, body){ event.reply(dbot.t('location')+" "+longurl);
event.reply(dbot.t('location')+" "+response.headers["location"]);
});
}); });
}, },
'~gstatus': function(event) { '~gstatus': function(event) {
data = this.api.githubStatus(function(data){ data = this.api.githubStatus(function(data){
console.log(data);
event.reply(dbot.t("status"+data["status"])); event.reply(dbot.t("status"+data["status"]));
event.reply(data["body"]); event.reply(data["body"]);
}.bind(this)); }.bind(this));
@ -87,10 +84,6 @@ var github = function(dbot) {
bar += "]"; bar += "]";
str += " is " + bar + progress + "% complete"; str += " is " + bar + progress + "% complete";
var longurl = "http://github.com/" + repo + "/issues?milestone=" + milestone["number"];
request({method: 'POST', uri: 'http://git.io', form:{url: longurl}}, function(error, response, body){
event.reply(response.headers["location"]);
});
event.reply(str); event.reply(str);
break; break;
} }
@ -146,8 +139,7 @@ var github = function(dbot) {
data = data[0]; data = data[0];
} }
} }
if (data["pull_request"]["html_url"]){ if (_.has(data["pull_request"], "html_url")){
console.log(data["pull_request"]["html_url"]);
data["pull_request"] = " with code"; data["pull_request"] = " with code";
} else { } else {
data["pull_request"] = ""; data["pull_request"] = "";