Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed Feb 19, 2025
2 parents d576505 + 89d50c8 commit 9e3f8d7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/references/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ Client Events

:param UserTokenPayload payload: The payload containing token information.

.. py:function:: event_subscription_revoked(payload: twitchio.models.eventsub_.SubscriptionRevoked) -> None
.. py:function:: event_subscription_revoked(payload: ~models.eventsub_.SubscriptionRevoked) -> None
:async:

Event dispatched when Twitch revokes a subscription. This can occur on websockets and webhooks.
Expand Down
5 changes: 5 additions & 0 deletions docs/references/eventsub_models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,11 @@ Eventsub
.. autoclass:: twitchio.StreamOffline()
:members:

.. attributetable:: twitchio.SubscriptionRevoked

.. autoclass:: twitchio.SubscriptionRevoked()
:members:

.. attributetable:: twitchio.UserAuthorizationGrant

.. autoclass:: twitchio.UserAuthorizationGrant()
Expand Down
25 changes: 25 additions & 0 deletions twitchio/models/eventsub_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5004,6 +5004,31 @@ def __repr__(self) -> str:


class SubscriptionRevoked:
"""Represents a revoked eventsub subscription by Twitch.
Attributes
----------
id: str
The ID of the subscription that has been revoked.
raw: RevocationSubscription
The raw payload of the revoked subscription as a TypedDict.
status: RevocationReason
The status provides the reason as to why the subscription was revoked by Twitch.
type: str
The type of subscription that was revoked e.g. `channel.follow`.
version: str
The version of the subscription e.g. `1` or `2`.
cost: int
The cost of the subscription.
transport_method: TransportMethod
The transport method of the subscription.
transport_data: RevocationTransport
The data pertaining to the transport of the subscription.
This will contain `session_id` or `callback` url depending on the transport method.
created_at: datetime.datetime
The datetime that the subscription was created.
"""

__slots__ = (
"cost",
"created_at",
Expand Down

0 comments on commit 9e3f8d7

Please sign in to comment.