8 Commits

Author SHA1 Message Date
fb8fc88101 1.4.4 2017-05-13 15:15:30 +02:00
6ca1254c9a Fix GitHub POST handler
1. robot.logger.debug didn't show any output
2. Send response for all requests
2017-05-13 15:14:22 +02:00
38483cbbeb 1.4.3 2017-05-12 14:02:54 +02:00
0203cb1a62 Fix typo 2017-05-12 14:02:46 +02:00
797fddfafb 1.4.2 2017-05-12 13:58:16 +02:00
82fe54b90a Fix string interpolation 2017-05-12 13:58:05 +02:00
4a8ea160a8 1.4.1 2017-05-12 01:39:55 +02:00
17543cb67b Return ether instead of wei 2017-05-12 01:39:27 +02:00
2 changed files with 7 additions and 5 deletions

View File

@@ -49,7 +49,7 @@ const Web3 = require('web3');
getBalance().then(balance => {
if (balance <= 0) {
messageRoom('Yo gang, I\m broke! Please drop me some ETH to ${hubotWalletAddress}. kthxbai.');
messageRoom(`Yo gang, I\'m broke! Please drop me some ETH to ${hubotWalletAddress}. kthxbai.`);
}
});
@@ -235,10 +235,10 @@ const Web3 = require('web3');
res.send(`HALP, I\'m totally broke! Not a single wei in my pocket.`);
}
else if (balance >= 1e+17) {
res.send(`my wallet contains ${balance} wei`);
res.send(`my wallet contains ${web3.fromWei(balance, 'ether')} ETH`);
}
else {
res.send(`I\'m almost broke! Only have ${balance} wei left in my pocket. :(`);
res.send(`I\'m almost broke! Only have ${web3.fromWei(balance, 'ether')} ETH left in my pocket. :(`);
}
});
});
@@ -246,13 +246,15 @@ const Web3 = require('web3');
robot.router.post('/incoming/kredits/github/'+process.env.KREDITS_WEBHOOK_TOKEN, (req, res) => {
let evt = req.header('X-GitHub-Event');
let data = req.body;
robot.logger.debug(`Received GitHub hook. Event: ${evt}, action: ${data.action}`);
robot.logger.info(`Received GitHub hook. Event: ${evt}, action: ${data.action}`);
if (evt === 'pull_request' && data.action === 'closed') {
handleGitHubPullRequestClosed(data).then(() => res.send(200));
}
else if (evt === 'issues' && data.action === 'closed') {
handleGitHubIssueClosed(data).then(() => res.send(200));
} else {
res.send(200);
}
});

View File

@@ -1,6 +1,6 @@
{
"name": "hubot-kredits",
"version": "1.4.0",
"version": "1.4.4",
"description": "Kosmos Kredits functionality for chat bots",
"main": "index.js",
"scripts": {