Emoji
Pycord provides two main emoji classes:GuildEmoji (aliased as Emoji) for custom guild emojis and PartialEmoji for emoji references.
GuildEmoji
Represents a custom emoji in a guild.Attributes
The emoji’s ID.
The name of the emoji.
If colons are required to use this emoji in the client (:PJSalt: vs PJSalt).
Whether an emoji is animated or not.
If this emoji is managed by a Twitch integration.
The guild ID the emoji belongs to.
Whether the emoji is available for use.
The user that created the emoji. This can only be retrieved using
Guild.fetch_emoji() and having the manage_emojis permission.A list of roles that is allowed to use this emoji. If roles is empty, the emoji is unrestricted.
The guild this emoji belongs to.
Returns the emoji’s creation time in UTC.
Returns the URL of the emoji.
Return a string that allows you to mention the emoji in a message.
Methods
is_usable()
is_usable()
Whether the bot can use this emoji.Returns:
bool - True if the bot can use this emoji.Example:async edit(**options)
async edit(**options)
Edits the custom emoji.Returns:
You must have
manage_emojis permission to do this.The new emoji name.
A list of roles that can use this emoji. An empty list can be passed to make it available to everyone.
The reason for editing this emoji. Shows up on the audit log.
GuildEmoji - The newly updated emoji.Example:async delete(reason=None)
async delete(reason=None)
Deletes the custom emoji.Example:
You must have
manage_emojis permission to do this.The reason for deleting this emoji. Shows up on the audit log.
PartialEmoji
Represents a partial emoji. This is useful for when you need to reference an emoji but don’t need all the information about it.Attributes
The emoji name.
The emoji’s ID. None if this is a unicode emoji.
Whether the emoji is animated.
Returns the URL of the emoji, if it is a custom emoji.
Checks whether this emoji is a custom emoji.
Checks whether this emoji is a unicode emoji.
Returns the emoji’s creation time in UTC, if it is a custom emoji.
Class Methods
PartialEmoji.from_str(value)
PartialEmoji.from_str(value)
Converts an emoji string to a Returns:
PartialEmoji.The emoji string to convert. Can be a unicode emoji or a custom emoji format like
<:name:id> or <a:name:id>.PartialEmoji - The partial emoji.Example:AppEmoji
Represents a custom emoji from an application.Attributes
The emoji’s ID.
The name of the emoji.
If colons are required to use this emoji in the client.
Whether an emoji is animated or not.
If this emoji is managed by a Twitch integration.
The application ID the emoji belongs to, if available.
Whether the emoji is available for use.
The user that created the emoji.
Methods
is_usable()
is_usable()
Whether the bot can use this emoji.Returns:
bool - True if the application ID matches the bot’s application ID.async edit(name)
async edit(name)
Edits the application emoji.Returns:
You must own the emoji to do this.
The new emoji name.
AppEmoji - The newly updated emoji.Example:async delete()
async delete()
Deletes the application emoji.Example:
You must own the emoji to do this.
