From 3b78bb52f166b6684523fc516405b34518a0947b Mon Sep 17 00:00:00 2001 From: plun1331 Date: Fri, 1 Dec 2023 21:54:56 +0000 Subject: [PATCH] docs: add documentation for monetization --- docs/api/data_classes.rst | 5 +++++ docs/api/enums.rst | 25 +++++++++++++++++++++++++ docs/api/events.rst | 36 ++++++++++++++++++++++++++++++++++++ docs/api/models.rst | 13 +++++++++++++ 4 files changed, 79 insertions(+) diff --git a/docs/api/data_classes.rst b/docs/api/data_classes.rst index ab9e8d678d..1f29b3b03c 100644 --- a/docs/api/data_classes.rst +++ b/docs/api/data_classes.rst @@ -128,6 +128,11 @@ Flags .. autoclass:: ChannelFlags() :members: +.. attributetable:: SKUFlags + +.. autoclass:: SKUFlags() + :members: + Colour ------ diff --git a/docs/api/enums.rst b/docs/api/enums.rst index 45317a37ce..f088b38bbf 100644 --- a/docs/api/enums.rst +++ b/docs/api/enums.rst @@ -2306,3 +2306,28 @@ of :class:`enum.Enum`. .. attribute:: burst Represents a super reaction. + +.. class:: SKUType + + Represents an SKU's type. + + .. versionadded:: 2.6 + + .. attribute:: subscription + + Represents a recurring subscription. + + .. attribute:: subscription_group + + A system-generated group for each subscription SKU created. These types of SKUs are currently unused. + + +.. class:: EntitlementType + + Represents an entitlement's type. + + .. versionadded:: 2.6 + + .. attribute:: app_subscription + + Entitlement was purchased as an app subscription. \ No newline at end of file diff --git a/docs/api/events.rst b/docs/api/events.rst index 2eb92c19b5..59ad26638b 100644 --- a/docs/api/events.rst +++ b/docs/api/events.rst @@ -410,6 +410,42 @@ Connection WebSocket library. It can be :class:`bytes` to denote a binary message or :class:`str` to denote a regular text message. +Entitlements +------------ +.. function:: on_entitlement_create(entitlement) + + Called when a user subscribes to an SKU. + + .. versionadded:: 2.6 + + :param entitlement: The entitlement that was created as a result of the subscription. + :type entitlement: :class:`Entitlement` + +.. function:: on_entitlement_update(entitlement) + + Called when a user's subscription to an Entitlement is renewed for the next billing period. + + .. versionadded:: 2.6 + + :param entitlement: The entitlement that was updated. + :type entitlement: :class:`Entitlement` + +.. function:: on_entitlement_delete(entitlement) + + Called when a user's entitlement is deleted. + + Entitlements are usually only deleted when Discord issues a refund for a subscription, + or manually removes an entitlement from a user. + + .. note:: + + This is not called when a user's subscription is cancelled. + + .. versionadded:: 2.6 + + :param entitlement: The entitlement that was deleted. + :type entitlement: :class:`Entitlement` + Guilds ------ .. function:: on_guild_join(guild) diff --git a/docs/api/models.rst b/docs/api/models.rst index 4d11fed63e..32dc925e1b 100644 --- a/docs/api/models.rst +++ b/docs/api/models.rst @@ -101,6 +101,19 @@ Messages .. autoclass:: ReactionCountDetails() :members: +Monetization +------------ + +.. attributetable:: SKU + +.. autoclass:: SKU() + :members: + +.. attributetable:: Entitlement + +.. autoclass:: Entitlement() + :members: + Guild -----