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

Commit 07d2c41

Browse files
author
Andreas Sas
committed
Feat: delete_videos
1 parent 95ddf1a commit 07d2c41

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/AthenaTwitchBot/data/twitch_api_urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ class TwitchApiURL(enum.Enum):
4646
hypetrain = "https://api.twitch.tv/helix/hypetrain/events"
4747
scopes = "https://id.twitch.tv/oauth2/validate"
4848
users = "https://api.twitch.tv/helix/users"
49-
eventsub_subscriptions ="https://api.twitch.tv/helix/eventsub/subscriptions"
49+
eventsub_subscriptions ="https://api.twitch.tv/helix/eventsub/subscriptions"
50+
videos = "https://api.twitch.tv/helix/videos"

src/AthenaTwitchBot/models/twitch_api/twitch_api.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,9 +1133,16 @@ async def get_videos(self):
11331133
return NotImplemented
11341134

11351135
# ------------------------------------------------------------------------------------------------------------------
1136+
@user_has_scope(scope=TwitchApiScopes.ChannelManageVideos)
11361137
@connected_to_twitch
1137-
async def delete_videos(self):
1138-
return NotImplemented
1138+
async def delete_videos(self,id_:str):
1139+
return await self._request(
1140+
callback=requests.delete,
1141+
url=TwitchApiURL.videos.value,
1142+
headers=self._header,
1143+
query_parameters={"id": id_}
1144+
1145+
)
11391146

11401147

11411148

0 commit comments

Comments
 (0)