diff --git a/package.json b/package.json index e3ae88a12..ef217874f 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "name": "logos", "description": "A multi-purpose community bot built to cater to language-learning communities on Discord.", "license": "ISC", - "version": "3.42.0", + "version": "3.42.1", "type": "module", "keywords": [ "discord", diff --git a/src/lib/commands/moderation/commands/rule.ts b/src/lib/commands/moderation/commands/rule.ts index 9b4815bfd..4f0e5e5df 100644 --- a/src/lib/commands/moderation/commands/rule.ts +++ b/src/lib/commands/moderation/commands/rule.ts @@ -84,7 +84,7 @@ async function handleCiteRule([client, bot]: [Client, Discord.Bot], interaction: return; } - const show = interaction.show ?? showParameter; + const show = interaction.show ?? showParameter ?? false; const locale = show ? interaction.guildLocale : interaction.locale; const ruleId = rules.at(ruleIndex); diff --git a/src/lib/commands/music/commands/now.ts b/src/lib/commands/music/commands/now.ts index f070cb1da..a24370d63 100644 --- a/src/lib/commands/music/commands/now.ts +++ b/src/lib/commands/music/commands/now.ts @@ -23,7 +23,12 @@ async function handleDisplayCurrentlyPlaying( [client, bot]: [Client, Discord.Bot], interaction: Logos.Interaction, ): Promise { - const [{ collection, show }] = parseArguments(interaction.data?.options, { collection: "boolean", show: "boolean" }); + const [{ collection, show: showParameter }] = parseArguments(interaction.data?.options, { + collection: "boolean", + show: "boolean", + }); + + const show = interaction.show ?? showParameter ?? false; const locale = show ? interaction.guildLocale : interaction.locale; const guildId = interaction.guildId; diff --git a/src/lib/commands/social/commands/profile/view.ts b/src/lib/commands/social/commands/profile/view.ts index d71bdd250..b60ffdead 100644 --- a/src/lib/commands/social/commands/profile/view.ts +++ b/src/lib/commands/social/commands/profile/view.ts @@ -6,7 +6,7 @@ import { Client, autocompleteMembers, localise, resolveInteractionToMember } fro import { Praise } from "../../../../database/praise"; import { User } from "../../../../database/user"; import { Warning } from "../../../../database/warning"; -import { parseArguments, reply } from "../../../../interactions"; +import { getShowButton, parseArguments, reply } from "../../../../interactions"; import { OptionTemplate } from "../../../command"; import { show, user } from "../../../parameters"; @@ -35,7 +35,9 @@ async function handleDisplayProfile( [client, bot]: [Client, Discord.Bot], interaction: Logos.Interaction, ): Promise { - const [{ user, show }] = parseArguments(interaction.data?.options, { show: "boolean" }); + const [{ user, show: showParameter }] = parseArguments(interaction.data?.options, { show: "boolean" }); + + const show = interaction.show ?? showParameter ?? false; const locale = show ? interaction.guildLocale : interaction.locale; const member = resolveInteractionToMember( @@ -149,6 +151,12 @@ async function handleDisplayProfile( sent: localise(client, "profile.options.view.strings.information.description.sent", locale)(), }; + const showButton = getShowButton(client, interaction, { locale }); + + const components: Discord.ActionRow[] | undefined = show + ? undefined + : [{ type: Discord.MessageComponentTypes.ActionRow, components: [showButton] }]; + reply( [client, bot], interaction, @@ -184,6 +192,7 @@ async function handleDisplayProfile( ], }, ], + components, }, { visible: show }, );