Class: Discordrb::Role::Tags
- Inherits:
-
Object
- Object
- Discordrb::Role::Tags
- Defined in:
- lib/discordrb/data/role.rb
Overview
Wrapper for the role tags
Instance Attribute Summary collapse
-
#available_for_purchase ⇒ true, false
readonly
Whether this role is available for purchase.
-
#bot_id ⇒ Integer?
readonly
The ID of the bot this role belongs to.
-
#guild_connections ⇒ true, false
readonly
Whether this role is a guild’s linked role.
-
#integration_id ⇒ Integer?
readonly
The ID of the integration this role belongs to.
-
#premium_subscriber ⇒ true, false
readonly
Whether this is the guild’s Booster role.
-
#subscription_listing_id ⇒ Integer?
readonly
The id of this role’s subscription sku and listing.
Instance Method Summary collapse
-
#initialize(data) ⇒ Tags
constructor
A new instance of Tags.
Constructor Details
#initialize(data) ⇒ Tags
Returns a new instance of Tags.
61 62 63 64 65 66 67 68 |
# File 'lib/discordrb/data/role.rb', line 61 def initialize(data) @bot_id = data['bot_id']&.resolve_id @integration_id = data['integration_id']&.resolve_id @premium_subscriber = data.key?('premium_subscriber') @subscription_listing_id = data['subscription_listing_id']&.resolve_id @available_for_purchase = data.key?('available_for_purchase') @guild_connections = data.key?('guild_connections') end |
Instance Attribute Details
#available_for_purchase ⇒ true, false (readonly)
Returns Whether this role is available for purchase.
56 57 58 |
# File 'lib/discordrb/data/role.rb', line 56 def available_for_purchase @available_for_purchase end |
#bot_id ⇒ Integer? (readonly)
Returns The ID of the bot this role belongs to.
44 45 46 |
# File 'lib/discordrb/data/role.rb', line 44 def bot_id @bot_id end |
#guild_connections ⇒ true, false (readonly)
Returns Whether this role is a guild’s linked role.
59 60 61 |
# File 'lib/discordrb/data/role.rb', line 59 def guild_connections @guild_connections end |
#integration_id ⇒ Integer? (readonly)
Returns The ID of the integration this role belongs to.
47 48 49 |
# File 'lib/discordrb/data/role.rb', line 47 def integration_id @integration_id end |
#premium_subscriber ⇒ true, false (readonly)
Returns Whether this is the guild’s Booster role.
50 51 52 |
# File 'lib/discordrb/data/role.rb', line 50 def premium_subscriber @premium_subscriber end |
#subscription_listing_id ⇒ Integer? (readonly)
Returns The id of this role’s subscription sku and listing.
53 54 55 |
# File 'lib/discordrb/data/role.rb', line 53 def subscription_listing_id @subscription_listing_id end |