From 6a0cb80447da32f23f2f73032304112bc9445cec Mon Sep 17 00:00:00 2001 From: nex Date: Fri, 24 Nov 2023 17:57:06 +0000 Subject: [PATCH] Support command references in starboard again --- cogs/starboard.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cogs/starboard.py b/cogs/starboard.py index 88e3f5e..7718385 100644 --- a/cogs/starboard.py +++ b/cogs/starboard.py @@ -96,11 +96,15 @@ class StarBoardCog(commands.Cog): embed.fields[1].value = field.value.replace(":\n>>> ", "") else: embed.fields[1].value += textwrap.shorten(ref.content, 1024 - len(field.value), placeholder="...") - elif message.interaction is not None: + if message.interaction is not None: inter: discord.MessageInteraction = message.interaction + if inter.type == discord.InteractionType.application_command: + cmd = "".format(inter.id, inter.name) + else: + cmd = repr(inter.name) embed.add_field( name="In response to", - value=f"Command '{inter.name}' by {inter.user.display_name}]):", + value=f"Command {cmd} by {inter.user.display_name}", inline=False, )