Class: Discordrb::Events::ServerRoleDeleteEvent

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

Overview

Raised when a role is deleted from a server

Instance Attribute Summary collapse

Attributes inherited from Event

#bot

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ ServerRoleDeleteEvent



50
51
52
53
54
55
56
57
# File 'lib/discordrb/events/roles.rb', line 50

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

#idInteger (readonly)



45
46
47
# File 'lib/discordrb/events/roles.rb', line 45

def id
  @id
end

#serverServer (readonly)



48
49
50
# File 'lib/discordrb/events/roles.rb', line 48

def server
  @server
end