Class: RubyCord::Guild::Webhook::Message::Author

Inherits:
DiscordModel
  • Object
show all
Defined in:
lib/rubycord/guild/webhook/message.rb

Overview

Represents an author of webhook message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiscordModel

#==, #eql?

Instance Attribute Details

#avatarRubyCord::User::Avatar (readonly)

Returns The avatar of the author.

Returns:



87
88
89
# File 'lib/rubycord/guild/webhook/message.rb', line 87

def avatar
  @avatar
end

#botBoolean (readonly) Also known as: bot?

Note:

This will be always true.

Returns Whether the author is a bot.

Returns:

  • (Boolean)

    Whether the author is a bot.



79
80
81
# File 'lib/rubycord/guild/webhook/message.rb', line 79

def bot
  @bot
end

#discriminatorString (readonly)

Returns The discriminator of the author.

Returns:

  • (String)

    The discriminator of the author.



89
90
91
# File 'lib/rubycord/guild/webhook/message.rb', line 89

def discriminator
  @discriminator
end

#idRubyCord::Snowflake (readonly)

Returns The ID of the author.

Returns:



82
83
84
# File 'lib/rubycord/guild/webhook/message.rb', line 82

def id
  @id
end

#usernameString (readonly) Also known as: name

Returns The name of the author.

Returns:

  • (String)

    The name of the author.



84
85
86
# File 'lib/rubycord/guild/webhook/message.rb', line 84

def username
  @username
end

Instance Method Details

#inspectString

Returns Object class and attributes.

Returns:

  • (String)

    Object class and attributes.



118
119
120
# File 'lib/rubycord/guild/webhook/message.rb', line 118

def inspect
  "#<#{self.class.name} #{self}>"
end

#to_sString Also known as: to_s_user

Format author with Name#Discriminator style.

Returns:

  • (String)

    Formatted author.



111
112
113
# File 'lib/rubycord/guild/webhook/message.rb', line 111

def to_s
  "#{@username}##{@discriminator}"
end