Catch issues with user not in guild, closes #144, closes #145

This commit is contained in:
Zeva Rose 2022-05-29 19:18:18 -06:00
parent f4da3dd5c9
commit 7ded85fa24
2 changed files with 6 additions and 0 deletions

View file

@ -34,6 +34,9 @@ class KickCog(ModcaseCog):
if len(reason) > 100:
await ctx.send("Reason must be < 100 characters", ephemeral=True)
return
if not ctx.guild.fetch_member(user.id):
await ctx.send("User must be in guild", ephemeral=True)
return
guild_name = ctx.guild.name
embed = build_embed(

View file

@ -170,6 +170,9 @@ class MuteCog(ModcaseCog):
if len(reason) > 100:
await ctx.send("Reason must be < 100 characters", ephemeral=True)
return
if not ctx.guild.fetch_member(user.id):
await ctx.send("User must be in guild", ephemeral=True)
return
# Max 4 weeks (2419200 seconds) per API
duration = time * scale