Class: Discorb::Webhook::Message::Author

Inherits:
DiscordModel show all
Defined in:
lib/discorb/webhook.rb

Overview

Represents an author of webhook message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiscordModel

#==, #eql?

Instance Attribute Details

#avatarDiscorb::Asset (readonly)

Returns The avatar of the author.

Returns:



452
453
454
# File 'lib/discorb/webhook.rb', line 452

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.



444
445
446
# File 'lib/discorb/webhook.rb', line 444

def bot
  @bot
end

#discriminatorString (readonly)

Returns The discriminator of the author.

Returns:

  • (String)

    The discriminator of the author.



454
455
456
# File 'lib/discorb/webhook.rb', line 454

def discriminator
  @discriminator
end

#idDiscorb::Snowflake (readonly)

Returns The ID of the author.

Returns:



447
448
449
# File 'lib/discorb/webhook.rb', line 447

def id
  @id
end

#usernameString (readonly) Also known as: name

Returns The name of the author.

Returns:

  • (String)

    The name of the author.



449
450
451
# File 'lib/discorb/webhook.rb', line 449

def username
  @username
end

Instance Method Details

#inspectObject



489
490
491
# File 'lib/discorb/webhook.rb', line 489

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.



483
484
485
# File 'lib/discorb/webhook.rb', line 483

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