Skip to content

Commit 291bd74

Browse files
committed
fetch VIP fix
fetch VIP fix
1 parent 6bab540 commit 291bd74

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

twitchio/http.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,15 +1005,15 @@ async def delete_channel_moderator(self, token: str, broadcaster_id: str, user_i
10051005
return await self.request(Route("DELETE", "moderation/moderators", query=q, token=token))
10061006

10071007
async def get_channel_vips(
1008-
self, token: str, broadcaster_id: str, first: int = 20, user_ids: Optional[List[str]] = None
1008+
self, token: str, broadcaster_id: str, first: int = 20, user_ids: Optional[List[int]] = None
10091009
):
10101010
q = [("broadcaster_id", broadcaster_id), ("first", first)]
10111011
if first > 100:
10121012
raise ValueError("You can only get up to 100 VIPs at once")
1013-
if user_ids and len(user_ids) <= 100:
1014-
q.extend(("user_id", user_id) for user_id in user_ids)
1015-
else:
1016-
raise ValueError("You can can only specify up to 100 VIPs")
1013+
if user_ids:
1014+
if len(user_ids) > 100:
1015+
raise ValueError("You can can only specify up to 100 VIPs")
1016+
q.extend(("user_id", str(user_id)) for user_id in user_ids)
10171017
return await self.request(Route("GET", "channels/vips", query=q, token=token))
10181018

10191019
async def post_channel_vip(self, token: str, broadcaster_id: str, user_id: str):

twitchio/user.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ async def delete_chat_messages(self, token: str, moderator_id: int, message_id:
11451145
broadcaster_id=str(self.id), token=token, moderator_id=str(moderator_id), message_id=message_id
11461146
)
11471147

1148-
async def fetch_channel_vips(self, token: str, first: int = 20, user_ids: Optional[List[str]] = None):
1148+
async def fetch_channel_vips(self, token: str, first: int = 20, user_ids: Optional[List[int]] = None):
11491149
"""|coro|
11501150
11511151
Fetches the list of VIPs for the specified channel/broadcaster.
@@ -1158,7 +1158,7 @@ async def fetch_channel_vips(self, token: str, first: int = 20, user_ids: Option
11581158
first: Optional[:class:`int`]
11591159
The maximum number of items to return per page in the response.
11601160
The minimum page size is 1 item per page and the maximum is 100. The default is 20.
1161-
user_ids: Optional[:class:`list`]
1161+
user_ids: Optional[List[:class:`int`]]
11621162
A list of user IDs to filter the results by.
11631163
The maximum number of IDs that you may specify is 100. Ignores those users in the list that aren't VIPs.
11641164

0 commit comments

Comments
 (0)