Skip to content

Commit 157c024

Browse files
committed
fuck typing
1 parent d682440 commit 157c024

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

twitchio/ext/eventsub/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ class BaseEvent:
137137
138138
Attributes
139139
-----------
140-
subscription: :class:`Subscription`
141-
The subscription attached to the message
140+
subscription: Optional[:class:`Subscription`]
141+
The subscription attached to the message. This is only optional when using the websocket eventsub transport
142142
headers: :class`Headers`
143143
The headers received with the message
144144
"""
@@ -163,15 +163,15 @@ def __init__(self, client: Union[EventSubClient, EventSubWSClient], _data: Union
163163
data = _data
164164

165165
self.headers: Union[Headers, WebsocketHeaders]
166+
self.subscription: Optional[Subscription]
166167

167168
if request:
168169
data: dict = _loads(_data)
169170
self.headers = Headers(request)
170-
self.subscription: Subscription = Subscription(data["subscription"])
171+
self.subscription = Subscription(data["subscription"])
171172
self.setup(data)
172173
else:
173174
self.headers = WebsocketHeaders(data)
174-
self.subscription: Optional[Subscription]
175175
if data["payload"]:
176176
self.subscription = Subscription(data["payload"]["subscription"])
177177
else:

0 commit comments

Comments
 (0)