Class: DiscordRDA::GuildCreateEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/discord_rda/event/base.rb

Instance Attribute Summary

Attributes inherited from Event

#data, #shard_id, #timestamp, #type

Instance Method Summary collapse

Methods inherited from Event

#created_at, #inspect, #to_h

Constructor Details

#initialize(data, shard_id:) ⇒ GuildCreateEvent

Returns a new instance of GuildCreateEvent.



244
245
246
# File 'lib/discord_rda/event/base.rb', line 244

def initialize(data, shard_id:)
  super('GUILD_CREATE', data, shard_id: shard_id)
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


252
253
254
# File 'lib/discord_rda/event/base.rb', line 252

def available?
  !@data['unavailable']
end

#guildObject



248
249
250
# File 'lib/discord_rda/event/base.rb', line 248

def guild
  @guild ||= Guild.new(@data)
end