Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit 95ddf1a

Browse files
author
Andreas Sas
committed
Feat: get_eventsub_subscriptions
1 parent 4d53d57 commit 95ddf1a

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/AthenaTwitchBot/models/twitch_api/twitch_api.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,16 +785,33 @@ async def delete_eventsub_subscription(
785785
return await self._request(
786786
callback=requests.delete,
787787
url=TwitchApiURL.eventsub_subscriptions.value,
788-
headers=self._header_json,
788+
headers=self._header,
789789
query_parameters={
790790
"id": id_
791791
}
792792
)
793793

794794
# ------------------------------------------------------------------------------------------------------------------
795795
@connected_to_twitch
796-
async def get_eventsub_subscriptions(self):
797-
return NotImplemented
796+
async def get_eventsub_subscriptions(
797+
self,*, status:str=None, type_:str=None, user_id:str=None, after:str
798+
):
799+
return await self._request(
800+
callback=requests.get,
801+
url=TwitchApiURL.eventsub_subscriptions.value,
802+
headers=self._header,
803+
query_parameters={
804+
k:v
805+
for k,v in
806+
{
807+
"status": status,
808+
"type":type_,
809+
"user_id":user_id,
810+
"after":after
811+
}.items()
812+
if v is not None
813+
}
814+
)
798815

799816
# ------------------------------------------------------------------------------------------------------------------
800817
@connected_to_twitch

0 commit comments

Comments
 (0)