aboutsummaryrefslogtreecommitdiff
path: root/discord/widget.py
diff options
context:
space:
mode:
Diffstat (limited to 'discord/widget.py')
-rw-r--r--discord/widget.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/discord/widget.py b/discord/widget.py
index c10b55cd..36b6e3dd 100644
--- a/discord/widget.py
+++ b/discord/widget.py
@@ -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)