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.



413
414
415
# File 'lib/discord_rda/event/base.rb', line 413

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

Instance Method Details

#guild_idObject



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

def guild_id
  @data['guild_id']
end

#roleObject



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

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