Class: DiscordRDA::ThreadListSyncEvent
- Inherits:
-
Event
- Object
- Event
- DiscordRDA::ThreadListSyncEvent
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
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_ids ⇒ Object
919
920
921
|
# File 'lib/discord_rda/event/base.rb', line 919
def channel_ids
@data['channel_ids'] || []
end
|
#guild_id ⇒ Object
915
916
917
|
# File 'lib/discord_rda/event/base.rb', line 915
def guild_id
@data['guild_id']
end
|
#members ⇒ Object
927
928
929
|
# File 'lib/discord_rda/event/base.rb', line 927
def members
@data['members'] || []
end
|
#thread_count ⇒ Object
931
932
933
|
# File 'lib/discord_rda/event/base.rb', line 931
def thread_count
threads.length
end
|
#threads ⇒ Object
923
924
925
|
# File 'lib/discord_rda/event/base.rb', line 923
def threads
@threads ||= (@data['threads'] || []).map { |t| Channel.new(t) }
end
|