Class: Discordrb::Events::ServerRoleDeleteEvent
- Defined in:
- lib/discordrb/events/roles.rb
Overview
Raised when a role is deleted from a server
Instance Attribute Summary collapse
-
#id ⇒ Integer
readonly
The ID of the role that got deleted.
-
#server ⇒ Server
readonly
The server on which a role got deleted.
Attributes inherited from Event
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ ServerRoleDeleteEvent
constructor
A new instance of ServerRoleDeleteEvent.
Constructor Details
#initialize(data, bot) ⇒ ServerRoleDeleteEvent
Returns a new instance of ServerRoleDeleteEvent.
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/discordrb/events/roles.rb', line 57 def initialize(data, bot) @bot = 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 ⇒ Integer (readonly)
Returns the ID of the role that got deleted.
52 53 54 |
# File 'lib/discordrb/events/roles.rb', line 52 def id @id end |
#server ⇒ Server (readonly)
Returns the server on which a role got deleted.
55 56 57 |
# File 'lib/discordrb/events/roles.rb', line 55 def server @server end |