feat: add role subscriptions (#8915)

* feat: add role subscriptions

* docs: casing

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
Almeida
2023-01-04 00:39:31 +00:00
committed by GitHub
parent 7dec892218
commit 3407e1eea3
3 changed files with 12 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ const IntegrationApplication = require('./IntegrationApplication');
* * `twitch`
* * `youtube`
* * `discord`
* * `guild_subscription`
* @typedef {string} IntegrationType
*/

View File

@@ -107,6 +107,8 @@ class Role extends Base {
* @property {Snowflake} [botId] The id of the bot this role belongs to
* @property {Snowflake|string} [integrationId] The id of the integration this role belongs to
* @property {true} [premiumSubscriberRole] Whether this is the guild's premium subscription role
* @property {Snowflake} [subscriptionListingId] The id of this role's subscription SKU and listing
* @property {true} [availableForPurchase] Whether this role is available for purchase
*/
this.tags = data.tags ? {} : null;
if (data.tags) {
@@ -119,6 +121,12 @@ class Role extends Base {
if ('premium_subscriber' in data.tags) {
this.tags.premiumSubscriberRole = true;
}
if ('subscription_listing_id' in data.tags) {
this.tags.subscriptionListingId = data.tags.subscription_listing_id;
}
if ('available_for_purchase' in data.tags) {
this.tags.availableForPurchase = true;
}
}
}

View File

@@ -5585,7 +5585,7 @@ export interface IntegrationAccount {
name: string;
}
export type IntegrationType = 'twitch' | 'youtube' | 'discord';
export type IntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription';
export type CollectedInteraction<Cached extends CacheType = CacheType> =
| StringSelectMenuInteraction<Cached>
@@ -6030,6 +6030,8 @@ export interface RoleTagData {
botId?: Snowflake;
integrationId?: Snowflake;
premiumSubscriberRole?: true;
subscriptionListingId?: Snowflake;
availableForPurchase?: true;
}
export interface SetChannelPositionOptions {