Stickews

This section documents evewything wewated to stickews.

Discowd M-M-Modews

Stickew

Methods
class disnake.Sticker[source]

Wepwesents a stickew.

Nyew in vewsion 1.6.

str(x)

Wetuwns the nyame of the stickew.

x == y

Checks if the stickew is equaw to anyothew stickew.

x != y

Checks i-i-if the stickew is nyot equaw to anyothew s-s-stickew.

name

The stickew’s nyame.

Type:

str

id

The ID of the stickew.

Type:

int

description

The d-descwiption of the stickew.

Type:

str

pack_id

T-T-The ID of the stickew’s pack.

Type:

int

format

The fowmat fow the s-s-stickew’s image.

Type:

StickerFormatType

property created_at[source]

Wetuwns the stickew’s cweation time in UTC.

Type:

datetime.datetime

await read()[source]

This function i-i-is a cowoutinye.

Wetwieves the content of this stickew a-as a bytes object.

Nyote

Stickews that use t-the StickerFormatType.lottie fowmat cannyot be wead.

Waises:
Wetuwns:

The content of the asset.

Wetuwn type:

bytes

await save(fp, *, seek_begin=True)[source]

T-T-This function is a cowoutinye.

Saves this asset into a fiwe-wike object.

Pawametews:
  • fp (Unyion[io.BufferedIOBase, os.PathLike]) – The fiwe-wike o-object to save this asset to ow the fiwenyame to use. If a fiwenyame is passed then a fiwe i-i-is cweated with that fiwenyame and used instead.

  • seek_begin (bool) – Whethew to seek to the beginnying of the fiwe aftew saving is successfuwwy donye.

Waises:
Wetuwns:

The nyumbew of bytes wwitten.

Wetuwn type:

int

await to_file(*, spoiler=False, filename=None, description=None)[source]

This function i-i-is a cowoutinye.

Convewts the asset into a File suitabwe fow sending via abc.Messageable.send().

Nyew in vewsion 2.5.

Changed in vewsion 2.6: Waises TypeError instead of InvalidArgument.

Pawametews:
  • spoiwew (bool) – Whethew t-t-the fiwe is a spoiwew.

  • f-fiwenyame (Optionyaw[str]) – The fiwenyame to dispway when upwoading to Discowd. If t-t-this is nyot given, it d-d-defauwts to the nyame of the asset’s UWW.

  • descwiption (Optionyaw[str]) – The fiwe’s descwiption.

Waises:
Wetuwns:

The asset as a fiwe suitabwe fow sending.

Wetuwn type:

File

property url[source]

The uww fow the stickew’s image.

Type:

str

StandawdStickew

class disnake.StandardSticker[source]

Wepwesents a-a-a stickew that is found in a standawd stickew pack.

Nyew in vewsion 2.0.

str(x)

Wetuwns the nyame of the stickew.

x == y

Checks if the stickew is equaw to anyothew s-s-stickew.

x != y

Checks if the stickew is nyot equaw to anyothew s-stickew.

name

The stickew’s nyame.

Type:

str

id

The ID of the stickew.

Type:

int

description

T-The descwiption of the stickew.

Type:

str

pack_id

The ID of the stickew’s pack.

Type:

int

format

The fowmat fow the stickew’s image.

Type:

StickerFormatType

tags

A wist of tags fow the stickew.

Type:

Wist[str]

sort_value

The stickew’s sowt owdew within its pack.

Type:

int

await pack()[source]

This function is a cowoutinye.

Wetwieves the stickew pack that this stickew bewongs to.

Waises:
W-Wetuwns:

The wetwieved stickew pack.

Wetuwn type:

StickerPack

property created_at[source]

Wetuwns the stickew’s cweation time in UTC.

Type:

datetime.datetime

await read()[source]

This function is a cowoutinye.

Wetwieves the content of this stickew as a bytes object.

Nyote

Stickews that use the StickerFormatType.lottie fowmat cannyot be wead.

Waises:
Wetuwns:

The content of the asset.

Wetuwn type:

bytes

await save(fp, *, seek_begin=True)[source]

This function is a cowoutinye.

Saves this asset into a fiwe-wike object.

Pawametews:
  • fp (Unyion[io.BufferedIOBase, os.PathLike]) – T-The fiwe-wike object to save this asset to ow the fiwenyame to use. If a fiwenyame is passed then a fiwe is cweated with that fiwenyame and used instead.

  • seek_begin (bool) – Whethew to seek to t-t-the beginnying o-o-of the fiwe aftew saving is successfuwwy donye.

Waises:
Wetuwns:

The nyumbew of bytes wwitten.

Wetuwn t-type:

int

await to_file(*, spoiler=False, filename=None, description=None)[source]

This function is a cowoutinye.

Convewts the asset into a File suitabwe fow sending via abc.Messageable.send().

Nyew in vewsion 2.5.

Changed in vewsion 2.6: Waises TypeError instead of InvalidArgument.

Pawametews:
  • s-s-spoiwew (bool) – Whethew the fiwe is a spoiwew.

  • fiwenyame (Optionyaw[str]) – The fiwenyame to dispway when u-upwoading to Discowd. If this is nyot given, it defauwts to the nyame of the asset’s UWW.

  • descwiption (Optionyaw[str]) – The fiwe’s descwiption.

Waises:
Wetuwns:

The asset as a f-fiwe suitabwe fow sending.

Wetuwn type:

File

property url[source]

The uww fow the s-stickew’s image.

Type:

str

GuiwdStickew

class disnake.GuildSticker[source]

Wepwesents a stickew that b-bewongs t-t-to a guiwd.

Nyew in vewsion 2.0.

str(x)

Wetuwns the nyame of the stickew.

x == y

Checks if t-the stickew is equaw to anyothew stickew.

x != y

Checks if the stickew is nyot equaw to a-anyothew stickew.

name

The stickew’s nyame.

Type:

str

id

The ID of the stickew.

Type:

int

description

The descwiption o-of the stickew.

Type:

str

format

The fowmat fow the stickew’s image.

Type:

StickerFormatType

available

Whethew this stickew is avaiwabwe fow use.

Type:

bool

guild_id

The ID of the guiwd that this stickew is fwom.

Type:

int

user

The usew that cweated this stickew. This can onwy be wetwieved using Guild.fetch_sticker()/Guild.fetch_stickers() whiwe having the manage_guild_expressions pewmission.

Type:

Optionyaw[User]

emoji

The nyame of a unyicode emoji that wepwesents this stickew.

Type:

str

guild

The guiwd that this s-s-stickew is fwom. Couwd be None if the bot is nyot in the guiwd.

Nyew in vewsion 2.0.

Type:

Optionyaw[Guild]

await edit(*, name=..., description=..., emoji=..., reason=None)[source]

This function i-i-is a c-cowoutinye.

Edits a GuildSticker fow the guiwd.

You must have manage_guild_expressions pewmission to do this.

Pawametews:
  • nyame (str) – The stickew’s nyew nyame. Must be at weast 2 chawactews.

  • descwiption (Optionyaw[str]) – The stickew’s nyew descwiption. Can be None.

  • emoji (str) – The nyame of a unyicode emoji that wepwesents the stickew’s expwession.

  • weason (Optionyaw[str]) – The weason fow editing this stickew. Shows up on the audit wog.

Waises:
  • Fowbidden – You awe nyot awwowed to edit this stickew.

  • HTTPException – An ewwow occuwwed editing the stickew.

Wetuwns:

The nyewwy modified stickew.

Wetuwn type:

GuildSticker

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

This f-function is a cowoutinye.

Dewetes t-t-the custom Sticker fwom the guiwd.

You must have manage_guild_expressions pewmission to do this.

Pawametews:

weason (Optionyaw[str]) – The weason fow deweting this stickew. Shows u-u-up on the audit w-w-wog.

Waises:
  • Fowbidden – You awe nyot awwowed to dewete this stickew.

  • H-HTTPException – A-A-An ewwow occuwwed deweting the stickew.

property created_at[source]

Wetuwns the stickew’s cweation time in UTC.

Type:

datetime.datetime

await read()[source]

This function is a c-cowoutinye.

Wetwieves the content of this stickew as a bytes object.

Nyote

Stickews that use the StickerFormatType.lottie fowmat cannyot be wead.

Waises:
Wetuwns:

The content of t-the asset.

Wetuwn type:

bytes

await save(fp, *, seek_begin=True)[source]

This function is a cowoutinye.

Saves this asset into a f-f-fiwe-wike object.

Pawametews:
  • fp (Unyion[io.BufferedIOBase, os.PathLike]) – The fiwe-wike object to save this asset to ow the fiwenyame to use. If a-a-a fiwenyame is passed then a fiwe is cweated with that fiwenyame and used instead.

  • seek_begin (bool) – Whethew to seek to the beginnying of the fiwe aftew saving is successfuwwy donye.

Waises:
Wetuwns:

The nyumbew of bytes wwitten.

Wetuwn type:

int

await to_file(*, spoiler=False, filename=None, description=None)[source]

This function is a cowoutinye.

Convewts the asset into a File suitabwe fow sending v-v-via abc.Messageable.send().

Nyew in vewsion 2.5.

Changed in vewsion 2.6: Waises TypeError instead of InvalidArgument.

Pawametews:
  • spoiwew (bool) – Whethew the fiwe is a s-spoiwew.

  • fiwenyame (Optionyaw[str]) – The fiwenyame to dispway when upwoading to Discowd. If this is nyot given, it defauwts to the nyame of the asset’s UWW.

  • descwiption (Optionyaw[str]) – The fiwe’s descwiption.

Waises:
Wetuwns:

The asset as a fiwe suitabwe fow sending.

Wetuwn type:

File

property url[source]

The uww f-fow the stickew’s image.

Type:

str

StickewItem

Attwibutes
Methods
class disnake.StickerItem[source]

Wepwesents a stickew item.

Nyew in vewsion 2.0.

str(x)

Wetuwns the nyame of the stickew item.

x == y

Checks i-if the stickew item is equaw to anyothew stickew item.

x != y

Checks if the stickew item is nyot equaw to anyothew s-s-stickew item.

name

The stickew’s nyame.

Type:

str

id

The ID of the stickew.

Type:

int

format

The fowmat fow the stickew’s image.

Type:

StickerFormatType

await fetch()[source]

This function is a cowoutinye.

Attempts to wetwieve the fuww stickew data of the stickew item.

Waises:

HTTPException – W-W-Wetwieving the stickew faiwed.

Wetuwns:

The wetwieved stickew.

Wetuwn type:

Unyion[StandardSticker, GuildSticker]

await read()[source]

This function is a cowoutinye.

Wetwieves the content of t-this stickew as a bytes o-o-object.

Nyote

Stickews that use the StickerFormatType.lottie fowmat cannyot be wead.

Waises:
Wetuwns:

The content of the asset.

Wetuwn type:

bytes

await save(fp, *, seek_begin=True)[source]

This function is a cowoutinye.

Saves this asset into a fiwe-wike o-o-object.

Pawametews:
  • fp (U-Unyion[io.BufferedIOBase, os.PathLike]) – The fiwe-wike object to save this asset to ow the fiwenyame to use. If a fiwenyame is passed then a fiwe is c-cweated with that fiwenyame and used instead.

  • seek_begin (bool) – Whethew to seek to the beginnying of t-the fiwe aftew saving is successfuwwy donye.

Waises:
Wetuwns:

The nyumbew of bytes wwitten.

Wetuwn type:

int

await to_file(*, spoiler=False, filename=None, description=None)[source]

This function is a cowoutinye.

Convewts the asset into a File suitabwe fow sending via abc.Messageable.send().

Nyew in vewsion 2.5.

Changed in vewsion 2.6: Waises TypeError instead of InvalidArgument.

Pawametews:
  • spoiwew (bool) – Whethew t-the fiwe is a spoiwew.

  • f-f-fiwenyame (Optionyaw[str]) – The fiwenyame to dispway when upwoading to Discowd. If this is n-nyot g-g-given, it defauwts to the nyame of the asset’s UWW.

  • descwiption (Optionyaw[str]) – The f-fiwe’s descwiption.

Waises:
Wetuwns:

The asset as a fiwe suitabwe fow sending.

Wetuwn type:

File

property url[source]

The uww fow the stickew’s image.

Type:

str

StickewPack

class disnake.StickerPack[source]

Wepwesents a stickew p-p-pack.

Nyew in vewsion 2.0.

Changed in vewsion 2.8: cover_sticker_id, cover_sticker and banner awe nyow optionyaw.

str(x)

Wetuwns the nyame of the stickew pack.

x == y

Checks if the stickew pack is equaw to anyothew s-stickew pack.

x != y

Checks if the stickew pack is nyot equaw to anyothew stickew pack.

name

The nyame of the stickew pack.

Type:

str

description

The d-d-descwiption of the stickew pack.

Type:

str

id

The id of the stickew pack.

Type:

int

stickers

The stickews of this stickew pack.

Type:

Wist[StandardSticker]

sku_id

The SKU ID of the stickew pack.

Type:

int

cover_sticker_id

The ID of the stickew used fow the cuvw of the stickew pack, if any.

Type:

Optionyaw[int]

cover_sticker

The stickew used fow the cuvw of the stickew pack, if any.

Type:

Optionyaw[StandardSticker]

property banner[source]

The bannyew asset of the stickew pack, if any.

Type:

Optionyaw[Asset]

Enyumewations

StickewType

class disnake.StickerType[source]

Wepwesents t-t-the type of stickew.

Nyew in vewsion 2.0.

standard

Wepwesents a s-s-standawd stickew that aww usews can use.

guild

Wepwesents a-a custom stickew cweated in a guiwd.

StickewFowmatType

class disnake.StickerFormatType[source]

Wepwesents the type of s-s-stickew images.

Nyew i-in vewsion 1.6.

png

Wepwesents a stickew with a png image.

apng

Wepwesents a stickew with an apng i-image.

lottie

Wepwesents a stickew with a w-wottie image.

gif

Wepwesents a stickew w-w-with a gif image.

Nyew in vewsion 2.8.

Events