From 9d0f2e38879c95de6a3f1b65360f560a12d71e94 Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Sat, 6 Jul 2024 18:58:04 -0400 Subject: [PATCH] misc(aurora): send evidenceformat to dms if `send_evidenceformat` is called outside of an Interaction context, as epheremal messages would be disabled in this case --- aurora/utilities/utils.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/aurora/utilities/utils.py b/aurora/utilities/utils.py index 1445537..467d66f 100644 --- a/aurora/utilities/utils.py +++ b/aurora/utilities/utils.py @@ -145,12 +145,13 @@ async def send_evidenceformat(ctx: commands.Context, moderation_id: int) -> None or await config.guild(guild=ctx.guild).auto_evidenceformat() or False ) - if send_evidence_bool is False: - return - - moderation = await Moderation.find_by_id(ctx.bot, moderation_id, ctx.guild.id) - content = await evidenceformat_factory(moderation=moderation) - await ctx.send(content=content, ephemeral=True) + if send_evidence_bool is True: + moderation = await Moderation.find_by_id(ctx.bot, moderation_id, ctx.guild.id) + content = await evidenceformat_factory(moderation=moderation) + if not ctx.interaction: + await ctx.author.send(content=content) + else: + await ctx.send(content=content, ephemeral=True) def get_bool_emoji(value: Optional[bool]) -> str: