Class: Discorb::PartialEmoji

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

Overview

Represents a partial custom emoji in discord.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiscordModel

#==, #eql?

Instance Attribute Details

#deletedBoolean (readonly) Also known as: deleted?

Returns Whether the emoji is deleted.

Returns:

  • (Boolean)

    Whether the emoji is deleted.



188
189
190
# File 'lib/discorb/emoji.rb', line 188

def deleted
  @deleted
end

#idDiscorb::Snowflake (readonly)

Returns The ID of the emoji.

Returns:



184
185
186
# File 'lib/discorb/emoji.rb', line 184

def id
  @id
end

#nameString (readonly)

Returns The name of the emoji.

Returns:

  • (String)

    The name of the emoji.



186
187
188
# File 'lib/discorb/emoji.rb', line 186

def name
  @name
end

Instance Method Details

#inspectObject



213
214
215
# File 'lib/discorb/emoji.rb', line 213

def inspect
  "#<#{self.class} id=#{@id} :#{@name}:>"
end

#to_sString

Format the emoji for sending.

Returns:

  • (String)

    the formatted emoji.



222
223
224
# File 'lib/discorb/emoji.rb', line 222

def to_s
  "<#{@animated ? "a" : ""}:#{@name}:#{@id}>"
end

#to_uriString

Format the emoji for URI.

Returns:

  • (String)

    the formatted emoji.



209
210
211
# File 'lib/discorb/emoji.rb', line 209

def to_uri
  "#{@name}:#{@id}"
end