class Discordrb::Events::ServerEvent

Generic subclass for server events (create/update/delete)

Attributes

server[R]

@return [Server] the server in question.

Public Class Methods

new(data, bot) click to toggle source
# File lib/discordrb/events/guilds.rb, line 12
def initialize(data, bot)
  @bot = bot

  init_server(data, bot)
end

Public Instance Methods

init_server(data, bot) click to toggle source

Initializes this event with server data. Should be overwritten in case the server doesn’t exist at the time of event creation (e. g. {ServerDeleteEvent})

# File lib/discordrb/events/guilds.rb, line 20
def init_server(data, bot)
  @server = bot.server(data['id'].to_i)
end