Class: Discorb::ThreadChannel::Member
- Inherits:
-
DiscordModel
- Object
- DiscordModel
- Discorb::ThreadChannel::Member
- Defined in:
- lib/discorb/channel/thread.rb
Overview
Represents a member in a thread.
Instance Attribute Summary collapse
-
#joined_at -> Object
readonly
Returns the value of attribute joined_at.
Instance Method Summary collapse
- #id -> Object
-
#initialize(client, data, guild_id) -> Member
constructor
A new instance of Member.
- #inspect -> Object
- #member -> Object
- #thread -> Object
- #user -> Object
Methods inherited from DiscordModel
Constructor Details
#initialize(client, data, guild_id) -> Member
Returns a new instance of Member.
328 329 330 331 332 333 334 |
# File 'lib/discorb/channel/thread.rb', line 328 def initialize(client, data, guild_id) @client = client @thread_id = data[:id] @user_id = data[:user_id] @joined_at = Time.iso8601(data[:join_timestamp]) @guild_id = guild_id end |
Instance Attribute Details
#joined_at -> Object (readonly)
Returns the value of attribute joined_at.
326 327 328 |
# File 'lib/discorb/channel/thread.rb', line 326 def joined_at @joined_at end |
Instance Method Details
#id -> Object
344 345 346 |
# File 'lib/discorb/channel/thread.rb', line 344 def id @user_id end |
#inspect -> Object
352 353 354 |
# File 'lib/discorb/channel/thread.rb', line 352 def inspect "#<#{self.class} id=#{@id.inspect}>" end |
#member -> Object
340 341 342 |
# File 'lib/discorb/channel/thread.rb', line 340 def member @client.guilds[@guild_id].members[@user_id] end |
#thread -> Object
336 337 338 |
# File 'lib/discorb/channel/thread.rb', line 336 def thread @client.channels[@thread_id] end |
#user -> Object
348 349 350 |
# File 'lib/discorb/channel/thread.rb', line 348 def user @client.users[@user_id] end |