fix adding thread to case if no reason is provided

This commit is contained in:
Brandon Silva 2022-11-25 02:32:01 -05:00
parent bf75836874
commit db0e283177

View file

@ -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}"))