Skip to content

Commit 011b1d5

Browse files
committed
Add description and set default
1 parent dc22d32 commit 011b1d5

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

twitchio/client.py

+7
Original file line numberDiff line numberDiff line change
@@ -831,10 +831,17 @@ async def fetch_content_classification_labels(self, locale: Optional[str] = None
831831
832832
Fetches information about Twitch content classification labels.
833833
834+
Parameters
835+
-----------
836+
locale: Optional[:class:`str`]
837+
Locale for the Content Classification Labels.
838+
You may specify a maximum of 1 locale. Default: “en-US”
839+
834840
Returns:
835841
List[:class:`twitchio.ContentClassificationLabel`]
836842
"""
837843

844+
locale = "en-US" if locale is None else locale
838845
data = await self._http.get_content_classification_labels(locale)
839846
return [models.ContentClassificationLabel(x) for x in data]
840847

twitchio/http.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,5 @@ async def get_global_chat_badges(self):
11371137
async def get_channel_chat_badges(self, broadcaster_id: str):
11381138
return await self.request(Route("GET", "chat/badges", "", query=[("broadcaster_id", broadcaster_id)]))
11391139

1140-
async def get_content_classification_labels(self, locale: Optional[str] = None):
1141-
q = [("locale", locale)] if locale is not None else []
1142-
return await self.request(Route("GET", "content_classification_labels", "", query=q))
1140+
async def get_content_classification_labels(self, locale: str):
1141+
return await self.request(Route("GET", "content_classification_labels", "", query=[("locale", locale)]))

0 commit comments

Comments
 (0)