From a6b9f785ace4820e4cf878d2a8e72462e052074c Mon Sep 17 00:00:00 2001 From: Red-GitHubBot <88117545+Red-GitHubBot@users.noreply.github.com> Date: Wed, 8 Sep 2021 21:43:04 +0200 Subject: [PATCH] [3.4] [Mod] Check if guild is unavailable in tempban expirations (#5173) (#5270) * [Mod] Check if guild.me is None else continue in tempban expirations. * Check for guild.unavailable instead of guild.me being None. (cherry picked from commit b586c2f99032d0b81bea229e9b2ffab00c96ba7b) Co-authored-by: PredaaA <46051820+PredaaA@users.noreply.github.com> Co-authored-by: PredaaA <46051820+PredaaA@users.noreply.github.com> --- redbot/cogs/mod/kickban.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redbot/cogs/mod/kickban.py b/redbot/cogs/mod/kickban.py index 63f078b15..ef21e4d6e 100644 --- a/redbot/cogs/mod/kickban.py +++ b/redbot/cogs/mod/kickban.py @@ -243,7 +243,7 @@ class KickBanMixin(MixinMeta): async for guild_id, guild_data in AsyncIter(guilds_data.items(), steps=100): if not (guild := self.bot.get_guild(guild_id)): continue - if not guild.me.guild_permissions.ban_members: + if guild.unavailable or not guild.me.guild_permissions.ban_members: continue if await self.bot.cog_disabled_in_guild(self, guild): continue