implement guild stickers

This commit is contained in:
Nadir Chowdhury
2021-07-31 02:25:41 +01:00
committed by GitHub
parent ecf239d2a2
commit 60d82cf908
16 changed files with 1120 additions and 86 deletions

View File

@ -926,7 +926,7 @@ to handle it, which defaults to print a traceback and ignoring the exception.
Called when a :class:`Guild` adds or removes :class:`Emoji`.
This requires :attr:`Intents.emojis` to be enabled.
This requires :attr:`Intents.emojis_and_stickers` to be enabled.
:param guild: The guild who got their emojis updated.
:type guild: :class:`Guild`
@ -935,6 +935,21 @@ to handle it, which defaults to print a traceback and ignoring the exception.
:param after: A list of emojis after the update.
:type after: Sequence[:class:`Emoji`]
.. function:: on_guild_stickers_update(guild, before, after)
Called when a :class:`Guild` updates its stickers.
This requires :attr:`Intents.emojis_and_stickers` to be enabled.
.. versionadded:: 2.0
:param guild: The guild who got their stickers updated.
:type guild: :class:`Guild`
:param before: A list of stickers before the update.
:type before: Sequence[:class:`GuildSticker`]
:param after: A list of stickers after the update.
:type after: Sequence[:class:`GuildSticker`]
.. function:: on_guild_available(guild)
on_guild_unavailable(guild)
@ -2205,6 +2220,63 @@ of :class:`enum.Enum`.
.. versionadded:: 2.0
.. attribute:: sticker_create
A sticker was created.
When this is the action, the type of :attr:`~AuditLogEntry.target` is
the :class:`GuildSticker` or :class:`Object` with the ID of the sticker
which was updated.
Possible attributes for :class:`AuditLogDiff`:
- :attr:`~AuditLogDiff.name`
- :attr:`~AuditLogDiff.emoji`
- :attr:`~AuditLogDiff.type`
- :attr:`~AuditLogDiff.format_type`
- :attr:`~AuditLogDiff.description`
- :attr:`~AuditLogDiff.available`
.. versionadded:: 2.0
.. attribute:: sticker_update
A sticker was updated.
When this is the action, the type of :attr:`~AuditLogEntry.target` is
the :class:`GuildSticker` or :class:`Object` with the ID of the sticker
which was updated.
Possible attributes for :class:`AuditLogDiff`:
- :attr:`~AuditLogDiff.name`
- :attr:`~AuditLogDiff.emoji`
- :attr:`~AuditLogDiff.type`
- :attr:`~AuditLogDiff.format_type`
- :attr:`~AuditLogDiff.description`
- :attr:`~AuditLogDiff.available`
.. versionadded:: 2.0
.. attribute:: sticker_delete
A sticker was deleted.
When this is the action, the type of :attr:`~AuditLogEntry.target` is
the :class:`GuildSticker` or :class:`Object` with the ID of the sticker
which was updated.
Possible attributes for :class:`AuditLogDiff`:
- :attr:`~AuditLogDiff.name`
- :attr:`~AuditLogDiff.emoji`
- :attr:`~AuditLogDiff.type`
- :attr:`~AuditLogDiff.format_type`
- :attr:`~AuditLogDiff.description`
- :attr:`~AuditLogDiff.available`
.. versionadded:: 2.0
.. attribute:: thread_create
A thread was created.
@ -2356,6 +2428,20 @@ of :class:`enum.Enum`.
.. class:: StickerType
Represents the type of sticker.
.. versionadded:: 2.0
.. attribute:: standard
Represents a standard sticker that all Nitro users can use.
.. attribute:: guild
Represents a custom sticker created in a guild.
.. class:: StickerFormatType
Represents the type of sticker images.
.. versionadded:: 1.6
@ -2825,15 +2911,9 @@ AuditLogDiff
.. attribute:: type
The type of channel or channel permission overwrite.
The type of channel or sticker.
If the type is an :class:`int`, then it is a type of channel which can be either
``0`` to indicate a text channel or ``1`` to indicate a voice channel.
If the type is a :class:`str`, then it is a type of permission overwrite which
can be either ``'role'`` or ``'member'``.
:type: Union[:class:`int`, :class:`str`]
:type: Union[:class:`ChannelType`, :class:`StickerType`]
.. attribute:: topic
@ -3040,6 +3120,38 @@ AuditLogDiff
:type: :class:`VideoQualityMode`
.. attribute:: format_type
The format type of a sticker being changed.
See also :attr:`GuildSticker.format_type`
:type: :class:`StickerFormatType`
.. attribute:: emoji
The name of the emoji that represents a sticker being changed.
See also :attr:`GuildSticker.emoji`
:type: :class:`str`
.. attribute:: description
The description of a sticker being changed.
See also :attr:`GuildSticker.description`
:type: :class:`str`
.. attribute:: available
The availability of a sticker being changed.
See also :attr:`GuildSticker.available`
:type: :class:`bool`
.. attribute:: archived
The thread is now archived.
@ -3620,6 +3732,22 @@ Widget
.. autoclass:: Widget()
:members:
StickerPack
~~~~~~~~~~~~~
.. attributetable:: StickerPack
.. autoclass:: StickerPack()
:members:
StickerItem
~~~~~~~~~~~~~
.. attributetable:: StickerItem
.. autoclass:: StickerItem()
:members:
Sticker
~~~~~~~~~~~~~~~
@ -3628,6 +3756,22 @@ Sticker
.. autoclass:: Sticker()
:members:
StandardSticker
~~~~~~~~~~~~~~~~
.. attributetable:: StandardSticker
.. autoclass:: StandardSticker()
:members:
GuildSticker
~~~~~~~~~~~~~
.. attributetable:: GuildSticker
.. autoclass:: GuildSticker()
:members:
RawMessageDeleteEvent
~~~~~~~~~~~~~~~~~~~~~~~