Catch failed DM to user
This commit is contained in:
parent
58e0ee892b
commit
a6252e262c
1 changed files with 5 additions and 1 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Reference in a new issue