Skip to content

Commit a97d8dc

Browse files
committed
fix: prevent None in self.user.guilds
1 parent 867ed5a commit a97d8dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

interactions/models/discord/user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def _add_guilds(self, guild_ids: Set["Snowflake_Type"]) -> None:
203203
@property
204204
def guilds(self) -> List["Guild"]:
205205
"""The guilds the user is in."""
206-
return [self._client.cache.get_guild(g_id) for g_id in self._guild_ids]
206+
return list(filter(None, (self._client.cache.get_guild(guild_id) for guild_id in self._guild_ids)))
207207

208208
async def edit(self, *, username: Absent[str] = MISSING, avatar: Absent[UPLOADABLE_TYPE] = MISSING) -> None:
209209
"""

0 commit comments

Comments
 (0)