Emojis

The following section documents everything related to emojis.

Models

BaseEmoji

class stoat.BaseEmoji(*, state, id, creator_id, name, animated, nsfw)[source]

Represents an emoji on Stoat.

This inherits from Base.

creator_id

The user’s ID who uploaded this emoji.

Type:

str

name

The emoji’s name.

Type:

str

animated

Whether the emoji is animated.

Type:

bool

nsfw

Whether the emoji is marked as NSFW.

Type:

bool

property image[source]

The emoji asset.

Type:

Asset

id

The ID of the entity.

Type:

str

state

The state that controls this entity.

Type:

State

ServerEmoji

class stoat.ServerEmoji(*, state, id, creator_id, name, animated, nsfw, server_id)[source]

Represents an emoji in Stoat Server.

This inherits from BaseEmoji.

server_id

The server’s ID the emoji belongs to.

Type:

str

get_creator()[source]

Optional[Union[Member, User]]: The user who uploaded this emoji.

get_creator_as_member()[source]

Optional[Member]: The user who uploaded this emoji.

get_creator_as_user()[source]

Optional[User]: The user who uploaded this emoji.

get_server()[source]

Optional[Server]: The server the emoji belongs to.

property creator[source]

The user who uploaded this emoji.

Type:

Union[Member, User]

property creator_as_member[source]

The user who uploaded this emoji.

Type:

Member

property creator_as_user[source]

The user who uploaded this emoji.

Type:

User

property server[source]

The server the emoji belongs to.

Type:

Server

await delete(*, http_overrides=None)[source]

This function is a coroutine.

Deletes the emoji.

You must have manage_customization to do this if you do not own the emoji, unless it was detached (already deleted).

May fire EmojiDeleteEvent for all server members.

Note

If deleting detached emoji, this will successfully return.

Note

Prior to API v0.8.4, this could only be used by non-bot accounts.

Parameters:

http_overrides (Optional[HTTPOverrideOptions]) – The HTTP request overrides.

Raises:
  • HTTPException – Possible values for type:

    Value

    Reason

    IsBot

    The current token belongs to bot account. Only applicable to instances running API whose version is lower than v0.8.3.

  • Unauthorized – Possible values for type:

    Value

    Reason

    InvalidSession

    The current bot/user token is invalid.

  • Forbidden – Possible values for type:

    Value

    Reason

    MissingPermission

    You do not have the proper permissions to delete an emoji.

  • NotFound – Possible values for type:

    Value

    Reason

    NotFound

    The emoji/server was not found.

  • InternalServerError – Possible values for type:

    Value

    Reason

    Populated attributes

    DatabaseError

    Something went wrong during querying database.

    collection, operation

to_dict()[source]

dict: Convert server emoji to raw data.

animated

Whether the emoji is animated.

Type:

bool

creator_id

The user’s ID who uploaded this emoji.

Type:

str

id

The ID of the entity.

Type:

str

property image[source]

The emoji asset.

Type:

Asset

name

The emoji’s name.

Type:

str

nsfw

Whether the emoji is marked as NSFW.

Type:

bool

state

The state that controls this entity.

Type:

State

DetachedEmoji

class stoat.DetachedEmoji(*, state, id, creator_id, name, animated, nsfw)[source]

Represents a deleted emoji on Stoat.

This inherits from BaseEmoji.

get_creator()[source]

Optional[User]: The user who uploaded this emoji.

property creator[source]

The user who uploaded this emoji.

Type:

User

animated

Whether the emoji is animated.

Type:

bool

creator_id

The user’s ID who uploaded this emoji.

Type:

str

id

The ID of the entity.

Type:

str

property image[source]

The emoji asset.

Type:

Asset

name

The emoji’s name.

Type:

str

nsfw

Whether the emoji is marked as NSFW.

Type:

bool

state

The state that controls this entity.

Type:

State

to_dict()[source]

dict: Convert detached emoji to raw data.

Emoji

class stoat.Emoji

An union of all emoji types.

The following classes are included in this union:

ResolvableEmoji

class stoat.ResolvableEmoji

An union of either BaseEmoji or str (which is either unicode emoji or emoji ID).

stoat.resolve_emoji(resolvable, /)[source]

Resolves emoji’s ID from parameter.

Parameters:

resolvable (ResolvableEmoji) – The object to resolve ID from.

Returns:

The resolved emoji’s ID.

Return type:

str