Class: Discordrb::Events::GuildRoleDeleteEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/events/guild_role_delete.rb

Overview

Raised when a role is deleted from a server

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/discordrb/events/guild_role_delete.rb', line 7

def id
  @id
end

#serverObject (readonly)

Returns the value of attribute server.



8
9
10
# File 'lib/discordrb/events/guild_role_delete.rb', line 8

def server
  @server
end