Skip to content

Commit

Permalink
Better logs
Browse files Browse the repository at this point in the history
  • Loading branch information
paris-ci committed Dec 11, 2023
1 parent 2f6f88a commit 46d5d65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/bot_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,13 @@ async def on_ready(self):
self.logger.info(message)

async def on_guild_join(self, guild):
self.logger.info(f"Joined guild {guild.name} ({guild.id})")
self.logger.info(f"Joined guild {guild.name} ({guild.id}), checking for bans...")
is_banned = await DiscordUser.filter(access_level_override=0).filter(discord_id=guild.owner_id).exists()
if is_banned:
await guild.leave()
self.logger.info(f"[🍑🕳] Automatically left guild I was invited in {guild.name} ({guild.id}) because the owner is banned.")
else:
self.logger.info(f"Joined guild {guild.name} ({guild.id})")
self.logger.info(f"Joined guild {guild.name} ({guild.id}), no bans :)")


async def get_prefix(bot: MyBot, message: discord.Message):
Expand Down

0 comments on commit 46d5d65

Please sign in to comment.