Class: Discordrb::Events::GuildEvent

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ GuildEvent

Returns a new instance of GuildEvent.



9
10
11
# File 'lib/discordrb/events/guilds.rb', line 9

def initialize(data, bot)
  init_server(data, bot)
end

Instance Attribute Details

#serverObject (readonly)

Returns the value of attribute server.



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

def server
  @server
end

Instance Method Details

#init_server(data, bot) ⇒ Object



13
14
15
# File 'lib/discordrb/events/guilds.rb', line 13

def init_server(data, bot)
  @server = bot.server(data['id'].to_i)
end