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.



239
240
241
# File 'lib/discord_rda/event/base.rb', line 239

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

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


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

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

#guildObject



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

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