Class: DiscordRDA::GuildRoleCreateEvent

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

Overview

Role events

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:) ⇒ GuildRoleCreateEvent

Returns a new instance of GuildRoleCreateEvent.



418
419
420
# File 'lib/discord_rda/event/base.rb', line 418

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

Instance Method Details

#guild_idObject



426
427
428
# File 'lib/discord_rda/event/base.rb', line 426

def guild_id
  @data['guild_id']
end

#roleObject



422
423
424
# File 'lib/discord_rda/event/base.rb', line 422

def role
  @role ||= Role.new(@data['role'].merge('guild_id' => @data['guild_id']))
end