mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
feat: role subscriptions (#9040)
* 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> * chore: version 13 specific things --------- Co-authored-by: Almeida <almeidx@pm.me>
This commit is contained in:
@@ -117,6 +117,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) {
|
||||
@@ -129,6 +131,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user