Class: Discordrb::Webhooks::EmbedFooter

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/webhooks/embeds.rb

Overview

An embed's footer will be displayed at the very bottom of an embed, together with the timestamp. An icon URL can be set together with some text to be displayed.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text: nil, icon_url: nil) ⇒ EmbedFooter

Creates a new footer object.



136
137
138
139
# File 'lib/discordrb/webhooks/embeds.rb', line 136

def initialize(text: nil, icon_url: nil)
  @text = text
  @icon_url = icon_url
end

Instance Attribute Details

#icon_urlString?



131
132
133
# File 'lib/discordrb/webhooks/embeds.rb', line 131

def icon_url
  @icon_url
end

#textString?



128
129
130
# File 'lib/discordrb/webhooks/embeds.rb', line 128

def text
  @text
end

Instance Method Details

#to_hashHash



142
143
144
145
146
147
# File 'lib/discordrb/webhooks/embeds.rb', line 142

def to_hash
  {
    text: @text,
    icon_url: @icon_url
  }
end