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

#avatar -> Discorb::Asset (readonly)

Returns The avatar of the author.

Returns:



405
406
407
# File 'lib/discorb/webhook.rb', line 405

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.



397
398
399
# File 'lib/discorb/webhook.rb', line 397

def bot
  @bot
end

#discriminator -> String (readonly)

Returns The discriminator of the author.

Returns:

  • (String)

    The discriminator of the author.



407
408
409
# File 'lib/discorb/webhook.rb', line 407

def discriminator
  @discriminator
end

#id -> Discorb::Snowflake (readonly)

Returns The ID of the author.

Returns:



400
401
402
# File 'lib/discorb/webhook.rb', line 400

def id
  @id
end

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

Returns The name of the author.

Returns:

  • (String)

    The name of the author.



402
403
404
# File 'lib/discorb/webhook.rb', line 402

def username
  @username
end

Instance Method Details

#inspect -> Object



435
436
437
# File 'lib/discorb/webhook.rb', line 435

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

#to_s -> String Also known as: to_s_user

Format author with Name#Discriminator style.

Returns:

  • (String)

    Formatted author.



429
430
431
# File 'lib/discorb/webhook.rb', line 429

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