class Discordrb::Webhooks::EmbedAuthor

An embed's author will be shown at the top to indicate who “authored” the particular event the webhook was sent for.

Attributes

icon_url[RW]

@return [String, nil] URL of the icon to be displayed next to the author

name[RW]

@return [String, nil] name of the author

url[RW]

@return [String, nil] URL the name should link to

Public Class Methods

new(name: nil, url: nil, icon_url: nil) click to toggle source

Creates a new author object. @param name [String, nil] The name of the author. @param url [String, nil] The URL the name should link to. @param icon_url [String, nil] The URL of the icon to be displayed next to the author.

# File lib/discordrb/webhooks/embeds.rb, line 204
def initialize(name: nil, url: nil, icon_url: nil)
  @name = name
  @url = url
  @icon_url = icon_url
end

Public Instance Methods

to_hash() click to toggle source

@return [Hash] a hash representation of this embed author, to be converted to JSON.

# File lib/discordrb/webhooks/embeds.rb, line 211
def to_hash
  {
    name: @name,
    url: @url,
    icon_url: @icon_url
  }
end