Skip to content

Commit

Permalink
impl (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
MCausc78 authored Feb 18, 2024
1 parent 7407767 commit 0deacf8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/http/managers/role_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ class RoleManager extends Manager<Role> {
return RoleTags(
botId: maybeParse(raw['bot_id'], Snowflake.parse),
integrationId: maybeParse(raw['integration_id'], Snowflake.parse),
isPremiumSubscriber: raw.containsKey('premium_subscriber'),
subscriptionListingId: maybeParse(raw['subscription_listing_id'], Snowflake.parse),
isAvailableForPurchase: raw.containsKey('available_for_purchase'),
isLinkedRole: raw.containsKey('guild_connections'),
);
}

Expand Down
12 changes: 12 additions & 0 deletions lib/src/models/role.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,27 @@ class RoleTags with ToStringHelper {
/// The ID of the integration this role belongs to.
final Snowflake? integrationId;

/// Whether this is the guild's Booster role.
final bool isPremiumSubscriber;

/// The ID of this role's subscription sku and listing.
final Snowflake? subscriptionListingId;

/// Whether this role is available for purchase.
final bool isAvailableForPurchase;

/// Whether this role is a guild's linked role
final bool isLinkedRole;

/// {@macro role_tags}
/// @nodoc
RoleTags({
required this.botId,
required this.integrationId,
required this.isPremiumSubscriber,
required this.subscriptionListingId,
required this.isAvailableForPurchase,
required this.isLinkedRole,
});
}

Expand Down

0 comments on commit 0deacf8

Please sign in to comment.