Class: Discorb::Webhook::Message::Author
- Inherits:
-
DiscordModel
- Object
- DiscordModel
- Discorb::Webhook::Message::Author
- Defined in:
- lib/discorb/webhook.rb
Overview
Represents an author of webhook message.
Instance Attribute Summary collapse
-
#avatar ⇒ Discorb::Asset
readonly
The avatar of the author.
-
#bot ⇒ Boolean
(also: #bot?)
readonly
Whether the author is a bot.
-
#discriminator ⇒ String
readonly
The discriminator of the author.
-
#id ⇒ Discorb::Snowflake
readonly
The ID of the author.
-
#username ⇒ String
(also: #name)
readonly
The name of the author.
Instance Method Summary collapse
- #inspect ⇒ Object
-
#to_s ⇒ String
(also: #to_s_user)
Format author with
Name#Discriminator
style.
Methods inherited from DiscordModel
Instance Attribute Details
#avatar ⇒ Discorb::Asset (readonly)
Returns The avatar of the author.
452 453 454 |
# File 'lib/discorb/webhook.rb', line 452 def avatar @avatar end |
#bot ⇒ Boolean (readonly) Also known as: bot?
Note:
This will be always true
.
Returns Whether the author is a bot.
444 445 446 |
# File 'lib/discorb/webhook.rb', line 444 def bot @bot end |
#discriminator ⇒ String (readonly)
Returns The discriminator of the author.
454 455 456 |
# File 'lib/discorb/webhook.rb', line 454 def discriminator @discriminator end |
#id ⇒ Discorb::Snowflake (readonly)
Returns The ID of the author.
447 448 449 |
# File 'lib/discorb/webhook.rb', line 447 def id @id end |
#username ⇒ String (readonly) Also known as: name
Returns The name of the author.
449 450 451 |
# File 'lib/discorb/webhook.rb', line 449 def username @username end |
Instance Method Details
#inspect ⇒ Object
489 490 491 |
# File 'lib/discorb/webhook.rb', line 489 def inspect "#<#{self.class.name} #{self}>" end |
#to_s ⇒ String Also known as: to_s_user
Format author with Name#Discriminator
style.
483 484 485 |
# File 'lib/discorb/webhook.rb', line 483 def to_s "#{@username}##{@discriminator}" end |