Class: RubyCord::Guild::Webhook::Message::Author
- Inherits:
-
DiscordModel
- Object
- DiscordModel
- RubyCord::Guild::Webhook::Message::Author
- Defined in:
- lib/rubycord/guild/webhook/message.rb
Overview
Represents an author of webhook message.
Instance Attribute Summary collapse
-
#avatar ⇒ RubyCord::User::Avatar
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 ⇒ RubyCord::Snowflake
readonly
The ID of the author.
-
#username ⇒ String
(also: #name)
readonly
The name of the author.
Instance Method Summary collapse
-
#inspect ⇒ String
Object class and attributes.
-
#to_s ⇒ String
(also: #to_s_user)
Format author with
Name#Discriminator
style.
Methods inherited from DiscordModel
Instance Attribute Details
#avatar ⇒ RubyCord::User::Avatar (readonly)
Returns The avatar of the author.
87 88 89 |
# File 'lib/rubycord/guild/webhook/message.rb', line 87 def avatar @avatar end |
#bot ⇒ Boolean (readonly) Also known as: bot?
Note:
This will be always true
.
Returns Whether the author is a bot.
79 80 81 |
# File 'lib/rubycord/guild/webhook/message.rb', line 79 def bot @bot end |
#discriminator ⇒ String (readonly)
Returns The discriminator of the author.
89 90 91 |
# File 'lib/rubycord/guild/webhook/message.rb', line 89 def discriminator @discriminator end |
#id ⇒ RubyCord::Snowflake (readonly)
Returns The ID of the author.
82 83 84 |
# File 'lib/rubycord/guild/webhook/message.rb', line 82 def id @id end |
#username ⇒ String (readonly) Also known as: name
Returns The name of the author.
84 85 86 |
# File 'lib/rubycord/guild/webhook/message.rb', line 84 def username @username end |
Instance Method Details
#inspect ⇒ String
Returns Object class and attributes.
118 119 120 |
# File 'lib/rubycord/guild/webhook/message.rb', line 118 def inspect "#<#{self.class.name} #{self}>" end |
#to_s ⇒ String Also known as: to_s_user
Format author with Name#Discriminator
style.
111 112 113 |
# File 'lib/rubycord/guild/webhook/message.rb', line 111 def to_s "#{@username}##{@discriminator}" end |