Skip to content

Commit b45fe9f

Browse files
author
Eviee Py
committed
Fix eventsub event parsing
1 parent c9fc373 commit b45fe9f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

twitchio/eventsub/websockets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ async def _process_revocation(self, data: RevocationMessage) -> None:
410410

411411
async def _process_notification(self, data: NotificationMessage) -> None:
412412
sub_type = data["metadata"]["subscription_type"]
413-
event = _SUB_MAPPING.get(sub_type, sub_type.removeprefix("channel."))
413+
event = _SUB_MAPPING.get(sub_type, sub_type.removeprefix("channel.")).replace(".", "_")
414414

415415
try:
416416
payload_class = create_event_instance(sub_type, data["payload"]["event"], http=self._http)

twitchio/web/aio_adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ async def eventsub_callback(self, request: web.Request) -> web.Response:
178178

179179
elif msg_type == "notification":
180180
sub_type: str = data["subscription"]["type"]
181-
event = _SUB_MAPPING.get(sub_type, sub_type.removeprefix("channel."))
181+
event = _SUB_MAPPING.get(sub_type, sub_type.removeprefix("channel.")).replace(".", "_")
182182

183183
try:
184184
payload_class = create_event_instance(sub_type, data["event"], http=self.client._http)

twitchio/web/starlette_adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ async def eventsub_callback(self, request: Request) -> Response:
191191

192192
elif msg_type == "notification":
193193
sub_type: str = data["subscription"]["type"]
194-
event = _SUB_MAPPING.get(sub_type, sub_type.removeprefix("channel."))
194+
event = _SUB_MAPPING.get(sub_type, sub_type.removeprefix("channel.")).replace(".", "_")
195195

196196
try:
197197
payload_class = create_event_instance(sub_type, data["event"], http=self.client._http)

0 commit comments

Comments
 (0)