Class: Discordrb::Events::GuildRoleDeleteEvent
- Inherits:
-
Object
- Object
- Discordrb::Events::GuildRoleDeleteEvent
- Defined in:
- lib/discordrb/events/guild_role_delete.rb
Overview
Raised when a role is deleted from a server
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ GuildRoleDeleteEvent
constructor
A new instance of GuildRoleDeleteEvent.
Constructor Details
#initialize(data, bot) ⇒ GuildRoleDeleteEvent
Returns a new instance of GuildRoleDeleteEvent.
10 11 12 13 14 15 16 17 |
# File 'lib/discordrb/events/guild_role_delete.rb', line 10 def initialize(data, bot) # The role should already be deleted from the server's list # by the time we create this event, so we'll create a temporary # role object for event consumers to use. @id = data['role_id'].to_i server_id = data['guild_id'].to_i @server = bot.server(server_id) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/discordrb/events/guild_role_delete.rb', line 7 def id @id end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
8 9 10 |
# File 'lib/discordrb/events/guild_role_delete.rb', line 8 def server @server end |