diff --git a/litecord/storage.py b/litecord/storage.py index ce58025..79d07dd 100644 --- a/litecord/storage.py +++ b/litecord/storage.py @@ -180,6 +180,18 @@ class Storage: drow = dict(row) + # a guild's unavailable state is kept in memory, and we remove every + # other guild related field when its unavailable. + drow['unavailable'] = self.app.guild_store.get( + guild_id, 'unavailable', False) + + if drow['unavailable']: + drow = { + 'id': drow['id'], + 'unavailable': True + } + + # guild.owner is dependant of the user doing the get_guild call. if user_id: drow['owner'] = drow['owner_id'] == str(user_id) @@ -192,17 +204,6 @@ class Storage: drow['max_presences'] = 1000 drow['max_members'] = 1000 - # a guild's unavailable state is kept in memory, and we remove every - # other guild related field when its unavailable. - drow['unavailable'] = self.app.guild_store.get( - guild_id, 'unavailable', False) - - if drow['unavailable']: - drow = { - 'id': drow['id'], - 'unavailable': True - } - return drow async def _member_basic(self, guild_id: int, member_id: int):