class Discorb::PartialEmoji

Represents a partial custom emoji in discord.

Attributes

deleted[R]

@return [Boolean] Whether the emoji is deleted.

deleted?[R]

@return [Boolean] Whether the emoji is deleted.

id[R]

@return [Discorb::Snowflake] The ID of the emoji.

name[R]

@return [String] The name of the emoji.

Public Class Methods

new(data) click to toggle source

@!visibility private

# File lib/discorb/emoji.rb, line 151
def initialize(data)
  @id = Snowflake.new(data[:id])
  @name = data[:name]
  @animated = data[:animated]
  @deleted = @name.nil?
end

Public Instance Methods

inspect() click to toggle source
# File lib/discorb/emoji.rb, line 167
def inspect
  "#<#{self.class} id=#{@id} :#{@name}:>"
end
to_s() click to toggle source

Format the emoji for sending.

@return [String] the formatted emoji.

# File lib/discorb/emoji.rb, line 176
def to_s
  "<#{@animated ? "a" : ""}:#{@name}:#{@id}>"
end
to_uri() click to toggle source

Format the emoji for URI.

@return [String] the formatted emoji.

# File lib/discorb/emoji.rb, line 163
def to_uri
  "#{@name}:#{@id}"
end