feat(Guild): add includeApplications option for fetchIntegrations (#4762)

This commit is contained in:
Sugden
2020-08-31 08:17:53 +01:00
committed by GitHub
parent 7ba9440053
commit 3141f7cb04
8 changed files with 211 additions and 137 deletions

View File

@@ -1,6 +1,7 @@
'use strict';
const Base = require('./Base');
const IntegrationApplication = require('./IntegrationApplication');
/**
* The information account for an integration
@@ -92,6 +93,20 @@ class Integration extends Base {
* @type {number}
*/
this.expireGracePeriod = data.expire_grace_period;
if ('application' in data) {
if (this.application) {
this.application._patch(data.application);
} else {
/**
* The application for this integration
* @type {?IntegrationApplication}
*/
this.application = new IntegrationApplication(this.client, data.application);
}
} else if (!this.application) {
this.application = null;
}
}
/**