Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 35f6acc150 | |||
| 095a1e0004 | |||
| 95290a7715 | |||
| fca017c61a | |||
| fb1a471303 | |||
| d82e2e9256 | |||
| 634dc207e6 | |||
| 6fd3989118 | |||
| 41f5aef460 | |||
| c121713a13 | |||
| e10dd4abc3 |
26
README.md
26
README.md
@@ -116,3 +116,29 @@ wiki's API on its own.
|
||||
|
||||
[kredits-contracts]: https://github.com/67P/kredits-contracts
|
||||
[GitHub OAuth app]: https://developer.github.com/apps/about-apps/#about-oauth-apps
|
||||
|
||||
|
||||
### Zoom
|
||||
|
||||
The Zoom integration creates contributions for meeting participations.
|
||||
|
||||
Every meeting that is longer than 15 minutes and with more than 2 participants will be registered.
|
||||
An optional meeting whitelist can be configured to create contributions only for specific meetings.
|
||||
|
||||
|
||||
#### Setup
|
||||
|
||||
A Zoom JWT app has to be set up and an [event webhook subscription](https://marketplace.zoom.us/docs/api-reference/webhook-reference/meeting-events/meeting-ending")
|
||||
on `meeting.ended` has to be configured to the following URL:
|
||||
|
||||
https://your-hubot.example.com/incoming/kredits/zoom/{webhook_token}
|
||||
|
||||
#### Config
|
||||
|
||||
| Key | Description |
|
||||
| --- | --- |
|
||||
| `KREDITS_ZOOM_JWT` | The JWT for the Zoom application (required)
|
||||
| `KREDITS_ZOOM_MEETING_WHITELIST` | Comma separated list of meeting names for which kredits should be tracked (optional)
|
||||
| `KREDITS_ZOOM_CONTRIBUTION_AMOUNT` | The amount of kredits issued for each meeting. (default: 500)
|
||||
|
||||
[Zoom apps](https://marketplace.zoom.us/user/build)
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = async function(robot, kredits) {
|
||||
|
||||
const { Contributor, Contribution } = kredits;
|
||||
|
||||
const kreditsContributionAmount = 500;
|
||||
const kreditsContributionAmount = process.env.KREDITS_ZOOM_CONTRIBUTION_AMOUNT || 500;
|
||||
const kreditsContributionKind = 'community';
|
||||
|
||||
const zoomAccessToken = process.env.KREDITS_ZOOM_JWT;
|
||||
@@ -69,14 +69,13 @@ module.exports = async function(robot, kredits) {
|
||||
async function handleZoomMeetingEnded(data) {
|
||||
const meetingDetails = await getMeetingDetails(data.uuid);
|
||||
const participants = await getMeetingParticipants(data.uuid);
|
||||
const names = Array.from(new Set(participants.map(p => p.name)));
|
||||
|
||||
if (meetingDetails.duration < 15 || meetingDetails.participants_count < 3) {
|
||||
if (meetingDetails.duration < 15 || names.length < 3) {
|
||||
robot.logger.info(`[hubot-kredits] Ignoring zoom call ${data.uuid} (duration: ${meetingDetails.duration}, participants_count: ${meetingDetails.participants_count})`);
|
||||
return;
|
||||
}
|
||||
|
||||
const names = Array.from(new Set(participants.map(p => p.name)));
|
||||
|
||||
for (const displayName of names) {
|
||||
await createContributionFor(displayName, meetingDetails);
|
||||
};
|
||||
@@ -88,7 +87,11 @@ module.exports = async function(robot, kredits) {
|
||||
const payload = data.payload;
|
||||
const object = payload.object;
|
||||
|
||||
if (eventName === 'meeting.ended') {
|
||||
|
||||
if (eventName === 'meeting.ended' && (
|
||||
!process.env.KREDITS_ZOOM_MEETING_WHITELIST ||
|
||||
process.env.KREDITS_ZOOM_MEETING_WHITELIST.split(',').includes(object.id)
|
||||
)) {
|
||||
handleZoomMeetingEnded(object);
|
||||
}
|
||||
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hubot-kredits",
|
||||
"version": "3.5.0",
|
||||
"version": "3.6.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hubot-kredits",
|
||||
"version": "3.5.0",
|
||||
"version": "3.6.0",
|
||||
"description": "Kosmos Kredits functionality for chat bots",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user