From ee5f9461aa6b354e9807546475d8b958d4ff82ff Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 5 Oct 2023 09:28:42 -0400 Subject: [PATCH] fix(moderation): fixed a few unawaited coroutines --- moderation/moderation.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/moderation/moderation.py b/moderation/moderation.py index 36f239a..6529e7e 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -195,7 +195,7 @@ class Moderation(commands.Cog): if moderation_type in ["kicked", "banned", "unbanned"]: guild_name = guild.name else: - guild_name = f"[{guild.name}]({await response.jump_url})" + guild_name = f"[{guild.name}]({response.jump_url})" if moderation_type in ["tempbanned", "muted"] and duration: embed_duration = f" for {humanize.precisedelta(duration)}" else: @@ -213,7 +213,7 @@ class Moderation(commands.Cog): """Warn a user.""" await interaction.response.send_message(content=f"{target.mention} has been warned!\n**Reason** - `{reason}`") try: - embed = await self.embed_factory('message', interaction.guild, reason, 'warned', interaction.original_response()) + embed = await self.embed_factory('message', interaction.guild, reason, 'warned', await interaction.original_response()) await target.send(embed=embed) except discord.errors.HTTPException: pass @@ -236,7 +236,7 @@ class Moderation(commands.Cog): await target.timeout(parsed_time) await interaction.response.send_message(content=f"{target.mention} has been muted for {humanize.precisedelta(parsed_time)}!\n**Reason** - `{reason}`") try: - embed = await self.embed_factory('message', interaction.guild, reason, 'muted', interaction.original_response(), parsed_time) + embed = await self.embed_factory('message', interaction.guild, reason, 'muted', await interaction.original_response(), parsed_time) await target.send(embed=embed) except discord.errors.HTTPException: pass @@ -255,7 +255,7 @@ class Moderation(commands.Cog): reason = "No reason given." await interaction.response.send_message(content=f"{target.mention} has been unmuted!\n**Reason** - `{reason}`") try: - embed = await self.embed_factory('message', interaction.guild, reason, 'unmuted', interaction.original_response()) + embed = await self.embed_factory('message', interaction.guild, reason, 'unmuted', await interaction.original_response()) await target.send(embed=embed) except discord.errors.HTTPException: pass @@ -266,7 +266,7 @@ class Moderation(commands.Cog): """Kick a user.""" await interaction.response.send_message(content=f"{target.mention} has been kicked!\n**Reason** - `{reason}`") try: - embed = await self.embed_factory('message', interaction.guild, reason, 'kicked', interaction.original_response()) + embed = await self.embed_factory('message', interaction.guild, reason, 'kicked', await interaction.original_response()) await target.send(embed=embed) except discord.errors.HTTPException: pass