mirror of
https://github.com/yuzu-emu/Command-fix.git
synced 2024-11-25 23:05:38 +01:00
Merge pull request #26 from BynariStar/patch-1
Change CitraBot GitHub message by comment type
This commit is contained in:
commit
06a69d9a30
@ -25,10 +25,17 @@ exports.execute = function (message) {
|
|||||||
// ex: You're #1!
|
// ex: You're #1!
|
||||||
if (match[1] <= 2000) { return; }
|
if (match[1] <= 2000) { return; }
|
||||||
|
|
||||||
|
// Map domain path to type
|
||||||
|
let map = {'pull': 'Pull Request', 'issues': 'Issue'};
|
||||||
|
|
||||||
let url = `https://github.com/citra-emu/citra/pull/${match[1]}`;
|
let url = `https://github.com/citra-emu/citra/pull/${match[1]}`;
|
||||||
request(url, function (error, response, body) {
|
request(url, function (error, response, body) {
|
||||||
if (!error && response.statusCode === 200) {
|
if (!error && response.statusCode === 200) {
|
||||||
message.channel.sendMessage(`Github Pull Request: ${url}`);
|
|
||||||
|
// Set path to type of comment (issues/pull)
|
||||||
|
let path = response.request.uri.pathname.split('/')[3];
|
||||||
|
|
||||||
|
message.channel.sendMessage(`Github ${map[path]}: ${url}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user