From db0e283177c97d2905dff51da984dadc61f83449 Mon Sep 17 00:00:00 2001 From: Brandon Silva Date: Fri, 25 Nov 2022 02:32:01 -0500 Subject: [PATCH] fix adding thread to case if no reason is provided --- punish/punish.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/punish/punish.py b/punish/punish.py index 3decdc0..53d35d3 100644 --- a/punish/punish.py +++ b/punish/punish.py @@ -1306,7 +1306,8 @@ class Punish(commands.Cog): # modify case to include mention to thread channel for easy access if thread_id is not None: try: - edits = {"reason": reason + f"\n\n<#{thread_id}>"} + new_reason = reason + f"\n\n<#{thread_id}>" if reason is not None else f"<#{thread_id}>" + edits = {"reason": new_reason} await case.edit(edits) except Exception as e: await ctx.send(warning(f"Couldn't edit case to add thread mention: {e}"))