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.



193
194
195
# File 'lib/discorb/emoji.rb', line 193

def deleted
  @deleted
end

#idDiscorb::Snowflake (readonly)

Returns The ID of the emoji.

Returns:



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

def id
  @id
end

#nameString (readonly)

Returns The name of the emoji.

Returns:

  • (String)

    The name of the emoji.



191
192
193
# File 'lib/discorb/emoji.rb', line 191

def name
  @name
end

Instance Method Details

#inspectObject



218
219
220
# File 'lib/discorb/emoji.rb', line 218

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

#to_sString

Format the emoji for sending.

Returns:

  • (String)

    the formatted emoji.



227
228
229
# File 'lib/discorb/emoji.rb', line 227

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

#to_uriString

Format the emoji for URI.

Returns:

  • (String)

    the formatted emoji.



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

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