This commit is contained in:
Zeva Rose 2021-07-19 13:29:19 -06:00
parent f48a4b827f
commit dd88f7fbee

View file

@ -106,8 +106,12 @@ class AdminCog(commands.Cog):
user_message += f"\nDuration: {duration} hours"
expiry = time + timedelta(hours=duration)
await user.send(user_message)
try:
await ctx.guild.ban(user, reason=reason)
except Exception as e:
await ctx.send(f"Failed to ban user:\n```\n{e}\n```", hidden=True)
return
await user.send(user_message)
if mtype == "soft":
await ctx.guild.unban(user, reason="Ban was softban")
await ctx.send(