mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +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;
|
title: string;
|
||||||
url: string;
|
url: string;
|
||||||
}[];
|
}[];
|
||||||
|
commands?: string[];
|
||||||
} & (
|
} & (
|
||||||
| {
|
| {
|
||||||
type: 'image';
|
type: 'image';
|
||||||
|
|||||||
@@ -43,7 +43,12 @@ export default async function handleChatInputCommand(
|
|||||||
|
|
||||||
const reply = await normalizeInteractionReturnable(returnable!);
|
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 (psa.data.type === 'embed') {
|
||||||
if (!reply.embeds) reply.embeds = [];
|
if (!reply.embeds) reply.embeds = [];
|
||||||
reply.embeds.push(embedWarning(psa.data.title, psa.data.description));
|
reply.embeds.push(embedWarning(psa.data.title, psa.data.description));
|
||||||
@@ -66,7 +71,12 @@ export default async function handleChatInputCommand(
|
|||||||
|
|
||||||
await interaction.editReply(reply);
|
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 = {
|
const followUp: InteractionReplyOptions = {
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user