diff --git a/src/core/discord/psa.ts b/src/core/discord/psa.ts index 7fd6fff7c..5f6d78f7c 100644 --- a/src/core/discord/psa.ts +++ b/src/core/discord/psa.ts @@ -4,6 +4,7 @@ export type PSAData = { title: string; url: string; }[]; + commands?: string[]; } & ( | { type: 'image'; diff --git a/src/events/interactionCreate/handlers/chatInputCommand.ts b/src/events/interactionCreate/handlers/chatInputCommand.ts index 471d08248..adb323b07 100644 --- a/src/events/interactionCreate/handlers/chatInputCommand.ts +++ b/src/events/interactionCreate/handlers/chatInputCommand.ts @@ -43,7 +43,12 @@ export default async function handleChatInputCommand( const reply = await normalizeInteractionReturnable(returnable!); - if (psa.data && !psa.data.secret) { + if ( + psa.data && + !psa.data.secret && + (psa.data.commands === undefined || + psa.data.commands.includes(interaction.commandName)) + ) { if (psa.data.type === 'embed') { if (!reply.embeds) reply.embeds = []; reply.embeds.push(embedWarning(psa.data.title, psa.data.description)); @@ -66,7 +71,12 @@ export default async function handleChatInputCommand( await interaction.editReply(reply); - if (psa.data && psa.data.secret) { + if ( + psa.data && + psa.data.secret && + (psa.data.commands === undefined || + psa.data.commands.includes(interaction.commandName)) + ) { const followUp: InteractionReplyOptions = { ephemeral: true, };