Skip to content

Commit 0158fc3

Browse files
committed
Add event_subscription_revoked docs
1 parent 8839e1c commit 0158fc3

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

docs/references/events.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,26 @@ Client Events
326326
See: :class:`~twitchio.Client.add_token` for more details.
327327

328328
:param UserTokenPayload payload: The payload containing token information.
329+
330+
.. py:function:: event_subscription_revoked(payload: twitchio.models.eventsub_.SubscriptionRevoked) -> None
331+
:async:
332+
333+
Event dispatched when Twitch revokes a subscription. This can occur on websockets and webhooks.
334+
You'll receive this message once and then no longer receive messages for the specified user and subscription type.
335+
336+
Webhook:
337+
- The user mentioned in the subscription no longer exists. The notification's status is set to `user_removed`.
338+
- The user revoked the authorization token or simply changed their password. The notification's status is set to `authorization_revoked`.
339+
- The callback failed to respond in a timely manner too many times. The notification's status is set to `notification_failures_exceeded`.
340+
- The subscribed to subscription type and version is no longer supported. The notification's status is set to `version_removed`.
341+
342+
Websocket:
343+
- The user mentioned in the subscription no longer exists. The notification's status field is set to `user_removed`.
344+
- The user revoked the authorization token that the subscription relied on. The notification's status field is set to `authorization_revoked`.
345+
- The subscribed to subscription type and version is no longer supported. The notification's status field is set to `version_removed`.
346+
347+
348+
:param SubscriptionRevoked payload: The payload containing token information.
329349

330350

331351
Commands Events

twitchio/events.pyi

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ if TYPE_CHECKING:
44
import twitchio
55

66
from .authentication import UserTokenPayload
7+
from .models.eventsub_ import SubscriptionRevoked
78

89
async def event_oauth_authorized(payload: UserTokenPayload) -> None:
910
"""Event dispatched when a user authorizes your Client-ID via Twitch OAuth on a built-in web adapter.
@@ -16,6 +17,26 @@ async def event_oauth_authorized(payload: UserTokenPayload) -> None:
1617
payload: UserTokenPayload
1718
"""
1819

20+
async def event_subscription_revoked(payload: SubscriptionRevoked) -> None:
21+
"""Event dispatched when Twitch revokes a subscription. This can occur on websockets and webhooks.
22+
You'll receive this message once and then no longer receive messages for the specified user and subscription type.
23+
24+
Webhook:
25+
- The user mentioned in the subscription no longer exists. The notification's status is set to `user_removed`.
26+
- The user revoked the authorization token or simply changed their password. The notification's status is set to `authorization_revoked`.
27+
- The callback failed to respond in a timely manner too many times. The notification's status is set to `notification_failures_exceeded`.
28+
- The subscribed to subscription type and version is no longer supported. The notification's status is set to `version_removed`.
29+
30+
Websocket:
31+
- The user mentioned in the subscription no longer exists. The notification's status field is set to `user_removed`.
32+
- The user revoked the authorization token that the subscription relied on. The notification's status field is set to `authorization_revoked`.
33+
- The subscribed to subscription type and version is no longer supported. The notification's status field is set to `version_removed`.
34+
35+
Parameters
36+
----------
37+
payload: SubscriptionRevoked
38+
"""
39+
1940
async def event_ready() -> None:
2041
"""Event dispatched when the Client is ready and has completed login."""
2142

0 commit comments

Comments
 (0)