hikari.stickers#
Application and entities that are used to describe stickers on Discord.
GuildSticker #
Bases: PartialSticker
Represents a Discord sticker that belongs to a guild.
description class-attribute instance-attribute #
The description of this sticker.
guild_id class-attribute instance-attribute #
The guild this sticker belongs to.
is_available class-attribute instance-attribute #
Whether the sticker can be used.
tag class-attribute instance-attribute #
This sticker's tag.
type class-attribute instance-attribute #
type: StickerType = attrs.field(
eq=False,
hash=False,
repr=False,
init=False,
default=StickerType.GUILD,
)
The sticker type.
user class-attribute instance-attribute #
The user that uploaded this sticker.
This will only be available if you have the hikari.permissions.Permissions.MANAGE_GUILD_EXPRESSIONS permission.
PartialSticker #
Bases: Unique
Represents the partial stickers found attached to messages on Discord.
format_type class-attribute instance-attribute #
format_type: StickerFormatType | int = attrs.field(
eq=False, hash=False, repr=True
)
The format of this sticker's asset.
id class-attribute instance-attribute #
The ID of this entity.
name class-attribute instance-attribute #
The name of the sticker.
make_url #
make_url(
*,
file_format: UndefinedOr[
Literal[
"LOTTIE",
"PNG",
"JPEG",
"JPG",
"WEBP",
"APNG",
"AWEBP",
"GIF",
]
] = UNDEFINED,
size: int = 4096,
lossless: bool = True,
) -> URL
Generate the image URL for this sticker.
| PARAMETER | DESCRIPTION |
|---|---|
file_format | The format to use for this URL. Supports LOTTIE is only available for TYPE: |
size | The size to set for the URL; This is ignored for TYPE: |
lossless | Whether to return a lossless or compressed WEBP image; This is ignored if TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
URL | The URL of the sticker. |
| RAISES | DESCRIPTION |
|---|---|
TypeError | If an invalid format is passed for |
ValueError | If |
StandardSticker #
Bases: PartialSticker
Represents a standard Discord sticker that belongs to a pack.
description class-attribute instance-attribute #
The description of this sticker.
pack_id class-attribute instance-attribute #
ID of the package this sticker belongs to.
sort_value class-attribute instance-attribute #
The sort value for the sticker in its pack.
tags class-attribute instance-attribute #
A sequence of this sticker's tags.
type class-attribute instance-attribute #
type: StickerType = attrs.field(
eq=False,
hash=False,
repr=False,
init=False,
default=StickerType.STANDARD,
)
The sticker type.
StickerFormatType #
Bases: int, Enum
The formats types of a sticker's asset.
LOTTIE class-attribute instance-attribute #
LOTTIE = 3
A lottie sticker.
More information can be found here: https://airbnb.io/lottie/
StickerPack #
Bases: Unique
Represents a sticker pack on Discord.
banner_asset_id class-attribute instance-attribute #
ID of the sticker pack's banner image, if set.
cover_sticker_id class-attribute instance-attribute #
The ID of a sticker in the pack which is shown as the pack's icon.
description class-attribute instance-attribute #
The description of the pack.
id class-attribute instance-attribute #
The ID of this entity.
name class-attribute instance-attribute #
The name of the pack.
sku_id class-attribute instance-attribute #
The ID of the packs SKU.
stickers class-attribute instance-attribute #
stickers: Sequence[StandardSticker] = attrs.field(
eq=False, hash=False, repr=False
)
The stickers that belong to this pack.
make_banner_url #
make_banner_url(
*,
file_format: Literal[
"PNG", "JPEG", "JPG", "WEBP"
] = "PNG",
size: int = 4096,
lossless: bool = True,
) -> URL | None
Generate the pack's banner image URL, if set.
If no banner image is set, this returns None.
| PARAMETER | DESCRIPTION |
|---|---|
file_format | The format to use for this URL. Supports If not specified, the format will be TYPE: |
size | The size to set for the URL; Can be any power of two between TYPE: |
lossless | Whether to return a lossless or compressed WEBP image; This is ignored if TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
Optional[URL] | The URL, or |
| RAISES | DESCRIPTION |
|---|---|
TypeError | If an invalid format is passed for |
ValueError | If |