Zoom integration #53
2
index.js
@@ -152,6 +152,8 @@ module.exports = async function(robot) {
|
||||
require('./integrations/github')(robot, kredits);
|
||||
require('./integrations/gitea')(robot, kredits);
|
||||
|
||||
require('./integrations/zoom')(robot, kredits);
|
||||
|
||||
if (typeof process.env.KREDITS_MEDIAWIKI_URL !== 'undefined') {
|
||||
require('./integrations/mediawiki')(robot, kredits);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ module.exports = async function(robot, kredits) {
|
||||
|
|
||||
});
|
||||
}
|
||||
|
||||
robot.router.post('/incoming/kredits/zoom'+process.env.KREDITS_WEBHOOK_TOKEN, (req, res) => {
|
||||
```suggestion
const { Contributor, Contribution } = kredits;
```
```suggestion
const contribution = {
```
This is a bit of an issue, because we sometimes use the Weekly Call room for other meetings. Not sure what the best solution is. Maybe just something generic like "Team/Community Call". This is a bit of an issue, because we sometimes use the Weekly Call room for other meetings. Not sure what the best solution is. Maybe just something generic like "Team/Community Call".
```suggestion
robot.logger.info(`[hubot-kredits] Ignoring zoom call ${data.uuid} (duration: ${meetingDetails.duration}, participants_count: ${meetingDetails.participants_count})`);
```
```suggestion
robot.logger.info(`[hubot-kredits] Contribution created: ${tx.hash}`);
```
```suggestion
robot.router.post('/incoming/kredits/zoom/'+process.env.KREDITS_WEBHOOK_TOKEN, (req, res) => {
```
|
||||
robot.router.post('/incoming/kredits/zoom/'+process.env.KREDITS_WEBHOOK_TOKEN, (req, res) => {
|
||||
```suggestion
const { Contributor, Contribution } = kredits;
```
```suggestion
const contribution = {
```
This is a bit of an issue, because we sometimes use the Weekly Call room for other meetings. Not sure what the best solution is. Maybe just something generic like "Team/Community Call". This is a bit of an issue, because we sometimes use the Weekly Call room for other meetings. Not sure what the best solution is. Maybe just something generic like "Team/Community Call".
```suggestion
robot.logger.info(`[hubot-kredits] Ignoring zoom call ${data.uuid} (duration: ${meetingDetails.duration}, participants_count: ${meetingDetails.participants_count})`);
```
```suggestion
robot.logger.info(`[hubot-kredits] Contribution created: ${tx.hash}`);
```
```suggestion
robot.router.post('/incoming/kredits/zoom/'+process.env.KREDITS_WEBHOOK_TOKEN, (req, res) => {
```
What's the case of tx being falsey (maybe makes sense to explain that in a comment)? Btw, I think we can replace the What's the case of tx being falsey (maybe makes sense to explain that in a comment)? Btw, I think we can replace the `then` with saving the result in a variable from the `await`, like so:
```js
const tx = await createContributionFor(displayName, meetingDetails);
if (tx) log(foo);
```
not sure how to best handle this one: https://github.com/67P/hubot-kredits/pull/53/files#diff-74e18db4da1da4461c9ccb134c582a3eR26 if the contributor is not found then there is no tx. not sure how to best handle this one: https://github.com/67P/hubot-kredits/pull/53/files#diff-74e18db4da1da4461c9ccb134c582a3eR26
if the contributor is not found then there is no tx.
Wait, if the contributor is not found, then the promise wouldn't resolve, would it? In that case it should reject. Wait, if the contributor is not found, then the promise wouldn't resolve, would it? In that case it should reject.
|
||||
let data = req.body;
|
||||
const eventName = data.event;
|
||||
const payload = data.payload;
|
||||
|
||||
```suggestion
const { Contributor, Contribution } = kredits;
```
```suggestion
const { Contributor, Contribution } = kredits;
```
```suggestion
const contribution = {
```
```suggestion
const contribution = {
```
This is a bit of an issue, because we sometimes use the Weekly Call room for other meetings. Not sure what the best solution is. Maybe just something generic like "Team/Community Call". This is a bit of an issue, because we sometimes use the Weekly Call room for other meetings. Not sure what the best solution is. Maybe just something generic like "Team/Community Call".
This is a bit of an issue, because we sometimes use the Weekly Call room for other meetings. Not sure what the best solution is. Maybe just something generic like "Team/Community Call". This is a bit of an issue, because we sometimes use the Weekly Call room for other meetings. Not sure what the best solution is. Maybe just something generic like "Team/Community Call".
```suggestion
robot.logger.info(`[hubot-kredits] Ignoring zoom call ${data.uuid} (duration: ${meetingDetails.duration}, participants_count: ${meetingDetails.participants_count})`);
```
```suggestion
robot.logger.info(`[hubot-kredits] Ignoring zoom call ${data.uuid} (duration: ${meetingDetails.duration}, participants_count: ${meetingDetails.participants_count})`);
```
```suggestion
robot.logger.info(`[hubot-kredits] Contribution created: ${tx.hash}`);
```
```suggestion
robot.logger.info(`[hubot-kredits] Contribution created: ${tx.hash}`);
```
```suggestion
robot.router.post('/incoming/kredits/zoom/'+process.env.KREDITS_WEBHOOK_TOKEN, (req, res) => {
```
```suggestion
robot.router.post('/incoming/kredits/zoom/'+process.env.KREDITS_WEBHOOK_TOKEN, (req, res) => {
```
|
||||
This is a bit of an issue, because we sometimes use the Weekly Call room for other meetings. Not sure what the best solution is. Maybe just something generic like "Team/Community Call".
This is a bit of an issue, because we sometimes use the Weekly Call room for other meetings. Not sure what the best solution is. Maybe just something generic like "Team/Community Call".