Skip to content

Commit

Permalink
docs: add documentation for monetization
Browse files Browse the repository at this point in the history
  • Loading branch information
plun1331 authored Dec 1, 2023
1 parent 513a21e commit 3b78bb5
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/api/data_classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ Flags
.. autoclass:: ChannelFlags()
:members:

.. attributetable:: SKUFlags

.. autoclass:: SKUFlags()
:members:

Colour
------

Expand Down
25 changes: 25 additions & 0 deletions docs/api/enums.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
36 changes: 36 additions & 0 deletions docs/api/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions docs/api/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ Messages
.. autoclass:: ReactionCountDetails()
:members:

Monetization
------------

.. attributetable:: SKU

.. autoclass:: SKU()
:members:

.. attributetable:: Entitlement

.. autoclass:: Entitlement()
:members:

Guild
-----

Expand Down

0 comments on commit 3b78bb5

Please sign in to comment.