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?, #hash

Instance Attribute Details

#avatar -> Discorb::Asset (readonly)

Returns The avatar of the author.

Returns:



360
361
362
# File 'lib/discorb/webhook.rb', line 360

def avatar
  @avatar
end

#bot -> Boolean (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.



352
353
354
# File 'lib/discorb/webhook.rb', line 352

def bot
  @bot
end

#discriminator -> String (readonly)

Returns The discriminator of the author.

Returns:

  • (String)

    The discriminator of the author.



362
363
364
# File 'lib/discorb/webhook.rb', line 362

def discriminator
  @discriminator
end

#id -> Discorb::Snowflake (readonly)

Returns The ID of the author.

Returns:



355
356
357
# File 'lib/discorb/webhook.rb', line 355

def id
  @id
end

#username -> String (readonly) Also known as: name

Returns The name of the author.

Returns:

  • (String)

    The name of the author.



357
358
359
# File 'lib/discorb/webhook.rb', line 357

def username
  @username
end

Instance Method Details

#to_s -> String Also known as: to_s_user

Format author with Name#Discriminator style.

Returns:

  • (String)

    Formatted author.



379
380
381
# File 'lib/discorb/webhook.rb', line 379

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