Type up **kwargs of various methods

This commit is contained in:
Nadir Chowdhury
2021-05-11 01:24:48 +01:00
committed by GitHub
parent 8bc489dba8
commit 757cfad38f
14 changed files with 453 additions and 72 deletions

View File

@ -175,7 +175,7 @@ class WidgetMember(BaseUser):
else:
activity = create_activity(game)
self.activity: Optional[Union[BaseActivity, Spotify]] = activity
self.activity: Optional[Union[BaseActivity, Spotify]] = activity
self.connected_channel: Optional[WidgetChannel] = connected_channel
@ -277,10 +277,10 @@ class Widget:
"""Optional[:class:`str`]: The invite URL for the guild, if available."""
return self._invite
async def fetch_invite(self, *, with_counts: bool = True) -> Optional[Invite]:
async def fetch_invite(self, *, with_counts: bool = True) -> Invite:
"""|coro|
Retrieves an :class:`Invite` from a invite URL or ID.
Retrieves an :class:`Invite` from the widget's invite URL.
This is the same as :meth:`Client.fetch_invite`; the invite
code is abstracted away.
@ -293,10 +293,9 @@ class Widget:
Returns
--------
Optional[:class:`Invite`]
The invite from the URL/ID.
:class:`Invite`
The invite from the widget's invite URL.
"""
if self._invite:
invite_id = resolve_invite(self._invite)
data = await self._state.http.get_invite(invite_id, with_counts=with_counts)
return Invite.from_incomplete(state=self._state, data=data)
invite_id = resolve_invite(self._invite)
data = await self._state.http.get_invite(invite_id, with_counts=with_counts)
return Invite.from_incomplete(state=self._state, data=data)