diff --git a/moderation/moderation.py b/moderation/moderation.py index dd6633b..935794c 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -332,6 +332,11 @@ class Moderation(commands.Cog): @app_commands.command(name="unban") async def unban(self, interaction: discord.Interaction, target: discord.User, reason: str = None): """Unban a user.""" + try: + await interaction.guild.fetch_ban(target) + except discord.errors.NotFound: + await interaction.response.send_message(content=f"{target.mention} is not banned!", ephemeral=True) + return if reason: await interaction.guild.unban(target.id, reason=f"Unbanned by {interaction.user.id} for: {reason}") else: