Class: DiscordRDA::ThreadListSyncEvent

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

Returns a new instance of ThreadListSyncEvent.



911
912
913
# File 'lib/discord_rda/event/base.rb', line 911

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

Instance Method Details

#channel_idsObject



919
920
921
# File 'lib/discord_rda/event/base.rb', line 919

def channel_ids
  @data['channel_ids'] || []
end

#guild_idObject



915
916
917
# File 'lib/discord_rda/event/base.rb', line 915

def guild_id
  @data['guild_id']
end

#membersObject



927
928
929
# File 'lib/discord_rda/event/base.rb', line 927

def members
  @data['members'] || []
end

#thread_countObject



931
932
933
# File 'lib/discord_rda/event/base.rb', line 931

def thread_count
  threads.length
end

#threadsObject



923
924
925
# File 'lib/discord_rda/event/base.rb', line 923

def threads
  @threads ||= (@data['threads'] || []).map { |t| Channel.new(t) }
end