mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: more advanced PSAs
This commit is contained in:
1 parent
95f4dbf6a0
commit
da56c563fc
2 files changed
+13
-2
No files matched your search
@@ -4,6 +4,7 @@ export type PSAData = {
|
||||
title: string;
|
||||
url: string;
|
||||
}[];
|
||||
commands?: string[];
|
||||
} & (
|
||||
| {
|
||||
type: 'image';
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user