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?, #hash

Instance Attribute Details

#deleted -> Boolean (readonly) Also known as: deleted?

Returns Whether the emoji is deleted.

Returns:

  • (Boolean)

    Whether the emoji is deleted.



140
141
142
# File 'lib/discorb/emoji.rb', line 140

def deleted
  @deleted
end

#id -> Discorb::Snowflake (readonly)

Returns The ID of the emoji.

Returns:



136
137
138
# File 'lib/discorb/emoji.rb', line 136

def id
  @id
end

#name -> String (readonly)

Returns The name of the emoji.

Returns:

  • (String)

    The name of the emoji.



138
139
140
# File 'lib/discorb/emoji.rb', line 138

def name
  @name
end

Instance Method Details

#inspect -> Object



160
161
162
# File 'lib/discorb/emoji.rb', line 160

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

#to_s -> String

Format the emoji for sending.

Returns:

  • (String)

    the formatted emoji.



169
170
171
# File 'lib/discorb/emoji.rb', line 169

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

#to_uri -> String

Format the emoji for URI.

Returns:

  • (String)

    the formatted emoji.



156
157
158
# File 'lib/discorb/emoji.rb', line 156

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