File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,15 @@ async def create_channel(self, channel: Channel) -> str:
25
25
response = await self .client .post (BASE_PATH , data = channel .to_json_request ())
26
26
return response .data .get ("result" , {}).get ("channelId" )
27
27
28
+ async def delete_channel (self , channel_id : str ) -> str :
29
+ response = await self .client .delete (f"{ BASE_PATH } /{ channel_id } " )
30
+ # return response.data.get("result", {}).get("channelId")
31
+ return (
32
+ "Successfully deleted the channel."
33
+ if response .status_code == 200
34
+ else response .data .get ("errorMessage" )
35
+ )
36
+
28
37
async def update_channel (self , channel : Channel ) -> str :
29
38
response = await self .client .put (BASE_PATH , data = channel .to_json_request ())
30
39
return response .data .get ("result" , {}).get ("channelId" )
Original file line number Diff line number Diff line change @@ -37,6 +37,22 @@ async def update_channel(self: "swibots.ApiClient", channel: Channel) -> str:
37
37
"""
38
38
return await self .community_service .channels .update_channel (channel )
39
39
40
+ async def delete_channel (self : "swibots.ApiClient" , id : str ) -> str :
41
+ """Delete channel
42
+
43
+ Args:
44
+ :obj:`swibots.api.community.models.Channel`: The channel object.
45
+
46
+ Returns:
47
+ str: status of channel
48
+
49
+ Raises:
50
+ :obj:`switch.error.SwitchError`: If the channel could not be retrieved
51
+
52
+ This method does the same as :meth:`switch.api.community.controllers.ChannelController.delete_channel`.
53
+ """
54
+ return await self .community_service .channels .delete_channel (id )
55
+
40
56
async def get_all_channels (
41
57
self : "swibots.ApiClient" , community_id : str
42
58
) -> List [Channel ]:
You can’t perform that action at this time.
0 commit comments