fix(moderation): awaited a coroutine
All checks were successful
Pylint / Pylint (push) Successful in 1m13s

This commit is contained in:
Seaswimmer 2023-10-04 12:59:26 -04:00
parent f792d9c149
commit 98f91b8ba3
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -184,12 +184,12 @@ class Moderation(commands.Cog):
await target.timeout(parsed_time)
response = await ctx.send(content=f"{target.mention} has been muted for {str(parsed_time)}!\n**Reason** - `{reason}`")
try:
embed = discord.Embed(title="Muted", description=f"You have been muted for `{str(parsed_time)}` in {ctx.guild.name}.", color=await self.bot.get_embed_color(None))
embed = discord.Embed(title="Muted", description=f"You have been muted for `{str(parsed_time)}` in [{ctx.guild.name}]({response.jump_url}).", color=await self.bot.get_embed_color(None))
embed.add_field(name='Reason', value=f"`{reason}`")
await target.send(embed=embed)
except discord.errors.HTTPException:
await response.edit(content=f"{response.content}\n*Failed to send DM, user likely has the bot blocked.*")
self.mysql_log(ctx.guild.id, ctx.author.id, 'MUTE', target.id, parsed_time, reason)
await self.mysql_log(ctx.guild.id, ctx.author.id, 'MUTE', target.id, parsed_time, reason)
@commands.group(autohelp=True)
@checks.admin()