async def parse_guild_delete(self, data, old): if old: old = Guild(state=self, data=old) if data.get("unavailable", False): new = Guild(state=self, data=data) self.dispatch("guild_unavailable", new) else: self.dispatch("guild_remove", old)
async def _get_guild(self, guild_id): result = await self.get(f"guild:{guild_id}") if result: guild = Guild(state=self, data=result) if not guild.unavailable: return guild return None
def _add_guild_from_data(self, guild): return Guild(state=self, data=guild)
async def _get_guild(self, guild_id): result = await self._get(f"guild:{guild_id}") if result: result = Guild(state=self, data=result) return result
async def _guilds(self): return [ Guild(state=self, data=x) for x in await self._members_get_all("guild") ]
async def _guilds(self): guilds = [ Guild(state=self, data=x) for x in await self._members_get_all("guild") ] return [x for x in guilds if not x.unavailable]