Skip to content

Commit

Permalink
Tidy docstrings
Browse files Browse the repository at this point in the history
Tidy docstrings
  • Loading branch information
chillymosh committed Jan 13, 2023
1 parent a0ef288 commit 1ccc25b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 43 deletions.
36 changes: 18 additions & 18 deletions twitchio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ async def wait_for(
Returns
--------
The arguments passed to the event.
The arguments passed to the event.
"""
fut = self.loop.create_future()
tup = (event, predicate, fut)
Expand Down Expand Up @@ -325,7 +325,7 @@ def get_channel(self, name: str) -> Optional[Channel]:
Returns
--------
:class:`.Channel`
:class:`.Channel`
"""
name = name.lower()

Expand Down Expand Up @@ -393,7 +393,7 @@ def create_user(self, user_id: int, user_name: str) -> PartialUser:
Returns
--------
:class:`twitchio.PartialUser`
:class:`twitchio.PartialUser`
"""
return PartialUser(self._http, user_id, user_name)

Expand Down Expand Up @@ -443,7 +443,7 @@ async def fetch_clips(self, ids: List[str]):
Returns
--------
List[:class:`twitchio.Clip`]
List[:class:`twitchio.Clip`]
"""
data = await self._http.get_clips(ids=ids)
return [models.Clip(self._http, d) for d in data]
Expand All @@ -465,7 +465,7 @@ async def fetch_channel(self, broadcaster: str, token: Optional[str] = None):
Returns
--------
:class:`twitchio.ChannelInfo`
:class:`twitchio.ChannelInfo`
"""

if not broadcaster.isdigit():
Expand Down Expand Up @@ -497,7 +497,7 @@ async def fetch_channels(self, broadcaster_ids: List[int], token: Optional[str]
Returns
--------
List[:class:`twitchio.ChannelInfo`]
List[:class:`twitchio.ChannelInfo`]
"""
from .models import ChannelInfo

Expand Down Expand Up @@ -541,7 +541,7 @@ async def fetch_videos(
Returns
--------
List[:class:`twitchio.Video`]
List[:class:`twitchio.Video`]
"""
from .models import Video

Expand Down Expand Up @@ -569,7 +569,7 @@ async def fetch_cheermotes(self, user_id: int = None):
Returns
--------
List[:class:`twitchio.CheerEmote`]
List[:class:`twitchio.CheerEmote`]
"""
data = await self._http.get_cheermotes(str(user_id) if user_id else None)
return [models.CheerEmote(self._http, x) for x in data]
Expand All @@ -581,7 +581,7 @@ async def fetch_global_emotes(self):
Returns
--------
List[:class:`twitchio.GlobalEmote`]
List[:class:`twitchio.GlobalEmote`]
"""
from .models import GlobalEmote

Expand All @@ -595,7 +595,7 @@ async def fetch_top_games(self) -> List[models.Game]:
Returns
--------
List[:class:`twitchio.Game`]
List[:class:`twitchio.Game`]
"""
data = await self._http.get_top_games()
return [models.Game(d) for d in data]
Expand All @@ -619,7 +619,7 @@ async def fetch_games(
Returns
--------
List[:class:`twitchio.Game`]
List[:class:`twitchio.Game`]
"""

data = await self._http.get_games(ids, names, igdb_ids)
Expand All @@ -637,7 +637,7 @@ async def fetch_tags(self, ids: Optional[List[str]] = None):
Returns
--------
List[:class:`twitchio.Tag`]
List[:class:`twitchio.Tag`]
"""
data = await self._http.get_stream_tags(ids)
return [models.Tag(x) for x in data]
Expand Down Expand Up @@ -725,7 +725,7 @@ async def search_categories(self, query: str):
Returns
--------
List[:class:`twitchio.Game`]
List[:class:`twitchio.Game`]
"""
data = await self._http.get_search_categories(query)
return [models.Game(x) for x in data]
Expand All @@ -744,7 +744,7 @@ async def search_channels(self, query: str, *, live_only=False):
Returns
--------
List[:class:`twitchio.SearchUser`]
List[:class:`twitchio.SearchUser`]
"""
data = await self._http.get_search_channels(query, live=live_only)
return [SearchUser(self._http, x) for x in data]
Expand All @@ -763,7 +763,7 @@ async def delete_videos(self, token: str, ids: List[int]) -> List[int]:
Returns
--------
List[:class:`int`]
List[:class:`int`]
"""
resp = []
for chunk in [ids[x : x + 3] for x in range(0, len(ids), 3)]:
Expand All @@ -785,7 +785,7 @@ async def fetch_chatters_colors(self, user_ids: List[int], token: Optional[str]
Returns
--------
List[:class:`twitchio.ChatterColor`]
List[:class:`twitchio.ChatterColor`]
"""
data = await self._http.get_user_chat_color(user_ids, token)
return [models.ChatterColor(self._http, x) for x in data]
Expand All @@ -807,7 +807,7 @@ async def update_chatter_color(self, token: str, user_id: int, color: str):
Returns
--------
None
None
"""
await self._http.put_user_chat_color(token=token, user_id=str(user_id), color=color)

Expand All @@ -818,7 +818,7 @@ async def get_webhook_subscriptions(self):
Returns
--------
List[:class:`twitchio.WebhookSubscription`]
List[:class:`twitchio.WebhookSubscription`]
"""
data = await self._http.get_webhook_subs()
return [models.WebhookSubscription(x) for x in data]
Expand Down
49 changes: 24 additions & 25 deletions twitchio/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ async def get_custom_rewards(
----------
token: :class:`str`
The users oauth token.
only_manageable : :class:`bool`
only_manageable: :class:`bool`
Whether to fetch all rewards or only ones you can manage. Defaults to false.
ids: List[:class:`int`]
An optional list of reward ids
Expand Down Expand Up @@ -368,8 +368,7 @@ async def fetch_hypetrain_events(self, id: str = None, token: str = None):
Returns
--------
List[:class:`twitchio.HypeTrainEvent`]
A list of hypetrain events
List[:class:`twitchio.HypeTrainEvent`]
"""
from .models import HypeTrainEvent

Expand Down Expand Up @@ -407,7 +406,7 @@ async def fetch_ban_events(self, token: str, userids: List[int] = None):
Returns
--------
List[:class:`twitchio.BanEvent`]
List[:class:`twitchio.BanEvent`]
"""
from .models import BanEvent

Expand All @@ -428,7 +427,7 @@ async def fetch_moderators(self, token: str, userids: List[int] = None):
Returns
--------
List[:class:`twitchio.PartialUser`]
List[:class:`twitchio.PartialUser`]
"""
data = await self._http.get_channel_moderators(token, str(self.id), user_ids=userids)
return [PartialUser(self._http, d["user_id"], d["user_name"]) for d in data]
Expand All @@ -445,7 +444,7 @@ async def fetch_mod_events(self, token: str):
Returns
--------
List[:class:`twitchio.ModEvent`]
List[:class:`twitchio.ModEvent`]
"""
from .models import ModEvent

Expand All @@ -466,7 +465,7 @@ async def automod_check(self, token: str, query: list):
Returns
--------
List[:class:`twitchio.AutomodCheckResponse`]
List[:class:`twitchio.AutomodCheckResponse`]
"""
from .models import AutomodCheckResponse

Expand All @@ -485,7 +484,7 @@ async def fetch_stream_key(self, token: str):
Returns
--------
:class:`str`
:class:`str`
"""
data = await self._http.get_stream_key(token, str(self.id))
return data
Expand All @@ -502,7 +501,7 @@ async def fetch_following(self, token: Optional[str] = None) -> List["FollowEven
Returns
--------
List[:class:`twitchio.FollowEvent`]
List[:class:`twitchio.FollowEvent`]
"""
from .models import FollowEvent

Expand All @@ -521,7 +520,7 @@ async def fetch_followers(self, token: Optional[str] = None):
Returns
--------
List[:class:`twitchio.FollowEvent`]
List[:class:`twitchio.FollowEvent`]
"""
from .models import FollowEvent

Expand All @@ -541,7 +540,7 @@ async def fetch_follow(self, to_user: "PartialUser", token: Optional[str] = None
Returns
--------
:class:`twitchio.FollowEvent`
:class:`twitchio.FollowEvent`
"""
if not isinstance(to_user, PartialUser):
raise TypeError(f"to_user must be a PartialUser not {type(to_user)}")
Expand All @@ -562,7 +561,7 @@ async def fetch_follower_count(self, token: Optional[str] = None) -> int:
Returns
--------
:class:`int`
:class:`int`
"""

data = await self._http.get_follow_count(token=token, to_id=str(self.id))
Expand All @@ -580,7 +579,7 @@ async def fetch_following_count(self, token: Optional[str] = None) -> int:
Returns
--------
:class:`int`
:class:`int`
"""
data = await self._http.get_follow_count(token=token, from_id=str(self.id))
return data["total"]
Expand All @@ -592,7 +591,7 @@ async def fetch_channel_emotes(self):
Returns
--------
List[:class:`twitchio.ChannelEmote`]
List[:class:`twitchio.ChannelEmote`]
"""
from .models import ChannelEmote

Expand Down Expand Up @@ -645,7 +644,7 @@ async def fetch_subscriptions(self, token: str, userids: Optional[List[int]] = N
Returns
--------
List[:class:`twitchio.SubscriptionEvent`]
List[:class:`twitchio.SubscriptionEvent`]
"""
from .models import SubscriptionEvent

Expand All @@ -666,7 +665,7 @@ async def create_marker(self, token: str, description: str = None):
Returns
--------
:class:`twitchio.Marker`
:class:`twitchio.Marker`
"""
from .models import Marker

Expand All @@ -688,7 +687,7 @@ async def fetch_markers(self, token: str, video_id: str = None):
Returns
--------
Optional[:class:`twitchio.VideoMarkers`]
Optional[:class:`twitchio.VideoMarkers`]
"""
from .models import VideoMarkers

Expand All @@ -708,7 +707,7 @@ async def fetch_extensions(self, token: str):
Returns
--------
List[:class:`twitchio.Extension`]
List[:class:`twitchio.Extension`]
"""
from .models import Extension

Expand All @@ -728,7 +727,7 @@ async def fetch_active_extensions(self, token: str = None):
Returns
--------
Dict[:class:`str`, Dict[:class:`int`, :class:`twitchio.ActiveExtension`]]
Dict[:class:`str`, Dict[:class:`int`, :class:`twitchio.ActiveExtension`]]
"""
from .models import ActiveExtension

Expand All @@ -749,7 +748,7 @@ async def update_extensions(self, token: str, extensions: "ExtensionBuilder"):
Returns
--------
Dict[:class:`str`, Dict[:class:`int`, :class:`twitchio.ActiveExtension`]]
Dict[:class:`str`, Dict[:class:`int`, :class:`twitchio.ActiveExtension`]]
"""
from .models import ActiveExtension

Expand All @@ -774,7 +773,7 @@ async def fetch_videos(self, period="all", sort="time", type="all", language=Non
Returns
--------
List[:class:`twitchio.Video`]
List[:class:`twitchio.Video`]
"""
from .models import Video

Expand Down Expand Up @@ -804,7 +803,7 @@ async def end_prediction(
Returns
--------
:class:`twitchio.Prediction`
:class:`twitchio.Prediction`
"""
from .models import Prediction

Expand Down Expand Up @@ -832,7 +831,7 @@ async def get_predictions(self, token: str, prediction_id: str = None) -> List["
Returns
--------
:class:`twitchio.Prediction`
:class:`twitchio.Prediction`
"""
from .models import Prediction

Expand Down Expand Up @@ -861,7 +860,7 @@ async def create_prediction(
Returns
--------
:class:`twitchio.Prediction`
:class:`twitchio.Prediction`
"""
from .models import Prediction

Expand Down Expand Up @@ -924,7 +923,7 @@ async def fetch_schedule(
Returns
--------
:class:`twitchio.Schedule`
:class:`twitchio.Schedule`
"""
from .models import Schedule

Expand Down

0 comments on commit 1ccc25b

Please sign in to comment.