Support command references in starboard again

This commit is contained in:
Nexus 2023-11-24 17:57:06 +00:00
parent 6b78174f12
commit 6a0cb80447
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -96,11 +96,15 @@ class StarBoardCog(commands.Cog):
embed.fields[1].value = field.value.replace(":\n>>> ", "") embed.fields[1].value = field.value.replace(":\n>>> ", "")
else: else:
embed.fields[1].value += textwrap.shorten(ref.content, 1024 - len(field.value), placeholder="...") 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 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( embed.add_field(
name="In response to", 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, inline=False,
) )