aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/widget.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/discord/widget.py b/discord/widget.py
index 11037fbb..291b70ef 100644
--- a/discord/widget.py
+++ b/discord/widget.py
@@ -204,8 +204,10 @@ class Widget:
channels = {channel.id: channel for channel in self.channels}
for member in data.get('members', []):
connected_channel = _get_as_snowflake(member, 'channel_id')
- if connected_channel:
+ if connected_channel in channels:
connected_channel = channels[connected_channel]
+ elif connected_channel:
+ connected_channel = WidgetChannel(id=connected_channel, name='', position=0)
self.members.append(WidgetMember(state=self._state, data=member, connected_channel=connected_channel))
@@ -230,7 +232,7 @@ class Widget:
@property
def invite_url(self):
- """Optiona[:class:`str`]: The invite URL for the guild, if available."""
+ """Optional[:class:`str`]: The invite URL for the guild, if available."""
return self._invite
async def fetch_invite(self, *, with_counts=True):