Class: Discordrb::Events::GuildRoleUpdateEvent
- Inherits:
-
Object
- Object
- Discordrb::Events::GuildRoleUpdateEvent
- Defined in:
- lib/discordrb/events/guild_role_update.rb
Overview
Event raised when a role updates on a server
Instance Attribute Summary collapse
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ GuildRoleUpdateEvent
constructor
A new instance of GuildRoleUpdateEvent.
Constructor Details
#initialize(data, bot) ⇒ GuildRoleUpdateEvent
Returns a new instance of GuildRoleUpdateEvent.
10 11 12 13 14 15 16 |
# File 'lib/discordrb/events/guild_role_update.rb', line 10 def initialize(data, bot) @server = bot.server(data['guild_id'].to_i) return unless @server role_id = data['role']['id'].to_i @role = @server.roles.find { |r| r.id == role_id } end |
Instance Attribute Details
#role ⇒ Object (readonly)
Returns the value of attribute role.
7 8 9 |
# File 'lib/discordrb/events/guild_role_update.rb', line 7 def role @role end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
8 9 10 |
# File 'lib/discordrb/events/guild_role_update.rb', line 8 def server @server end |