Downgrade to v13

[vi] cảm giác đau khổ
This commit is contained in:
March 7th
2022-03-24 17:55:32 +07:00
parent 9596b1a210
commit 7dfdef46a5
218 changed files with 8584 additions and 9108 deletions

View File

@@ -1,6 +1,5 @@
'use strict';
const { Routes } = require('discord-api-types/v9');
const Base = require('./Base');
const IntegrationApplication = require('./IntegrationApplication');
@@ -56,21 +55,17 @@ class Integration extends Base {
*/
this.enabled = data.enabled;
if ('syncing' in data) {
/**
* Whether this integration is syncing
* @type {?boolean}
*/
this.syncing = data.syncing;
} else {
this.syncing ??= null;
}
/**
* Whether this integration is syncing
* @type {?boolean}
*/
this.syncing = data.syncing;
/**
* The role that this integration uses for subscribers
* @type {?Role}
*/
this.role = this.guild.roles.resolve(data.role_id);
this.role = this.guild.roles.cache.get(data.role_id);
if ('enable_emoticons' in data) {
/**
@@ -89,7 +84,7 @@ class Integration extends Base {
*/
this.user = this.client.users._add(data.user);
} else {
this.user ??= null;
this.user = null;
}
/**
@@ -98,15 +93,11 @@ class Integration extends Base {
*/
this.account = data.account;
if ('synced_at' in data) {
/**
* The timestamp at which this integration was last synced at
* @type {?number}
*/
this.syncedTimestamp = Date.parse(data.synced_at);
} else {
this.syncedTimestamp ??= null;
}
/**
* The last time this integration was last synced
* @type {?number}
*/
this.syncedAt = data.synced_at;
if ('subscriber_count' in data) {
/**
@@ -131,15 +122,6 @@ class Integration extends Base {
this._patch(data);
}
/**
* The date at which this integration was last synced at
* @type {?Date}
* @readonly
*/
get syncedAt() {
return this.syncedTimestamp && new Date(this.syncedTimestamp);
}
/**
* All roles that are managed by this integration
* @type {Collection<Snowflake, Role>}
@@ -154,21 +136,17 @@ class Integration extends Base {
if ('expire_behavior' in data) {
/**
* The behavior of expiring subscribers
* @type {?IntegrationExpireBehavior}
* @type {?number}
*/
this.expireBehavior = data.expire_behavior;
} else {
this.expireBehavior ??= null;
}
if ('expire_grace_period' in data) {
/**
* The grace period (in days) before expiring subscribers
* The grace period before expiring subscribers
* @type {?number}
*/
this.expireGracePeriod = data.expire_grace_period;
} else {
this.expireGracePeriod ??= null;
}
if ('application' in data) {