class Discordrb::Events::ServerRoleDeleteEvent

Raised when a role is deleted from a server

Attributes

id[R]

@return [Integer] the ID of the role that got deleted.

server[R]

@return [Server] the server on which a role got deleted.

Public Class Methods

new(data, bot) click to toggle source
# 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