Catch failed DM to user

This commit is contained in:
Zeva Rose 2022-03-25 12:47:24 -06:00
parent 58e0ee892b
commit a6252e262c

View file

@ -59,7 +59,11 @@ class KickCog(ModcaseCog):
await user.send(embed=embed)
except Exception:
send_failed = True
await ctx.guild.kick(user, reason=reason)
try:
await ctx.guild.kick(user, reason=reason)
except Exception as e:
await ctx.send(f"Failed to kick user:\n```\n{e}\n```", ephemeral=True)
return
fields = [EmbedField(name="DM Sent?", value=str(not send_failed))]
embed = build_embed(