floposite command

This commit is contained in:
Milo
2025-07-03 16:37:47 +02:00
parent 52b7d5221d
commit 3ce95ca6be
2 changed files with 39 additions and 1 deletions

View File

@@ -91,6 +91,14 @@ const SKINS_COMMAND = {
contexts: [0, 2],
}
const SITE_COMMAND = {
name: 'floposite',
description: 'Lien vers FlopoSite',
type: 1,
integration_types: [0, 1],
contexts: [0, 2],
}
const SEARCH_SKIN_COMMAND = {
name: 'search',
description: 'Chercher un skin',
@@ -107,6 +115,6 @@ const SEARCH_SKIN_COMMAND = {
contexts: [0, 2],
}
const ALL_COMMANDS = [TIMEOUT_COMMAND, INVENTORY_COMMAND, VALORANT_COMMAND, INFO_COMMAND, SKINS_COMMAND, SEARCH_SKIN_COMMAND];
const ALL_COMMANDS = [TIMEOUT_COMMAND, INVENTORY_COMMAND, VALORANT_COMMAND, INFO_COMMAND, SKINS_COMMAND, SEARCH_SKIN_COMMAND, SITE_COMMAND];
InstallGlobalCommands(process.env.APP_ID, ALL_COMMANDS);

View File

@@ -1386,6 +1386,36 @@ app.post('/interactions', verifyKeyMiddleware(process.env.PUBLIC_KEY), async fun
});
}
if (name === 'floposite') {
const originalComponents = [
{
type: MessageComponentTypes.BUTTON,
label: 'Aller sur FlopoSite',
style: ButtonStyleTypes.LINK,
url: 'https://floposite.netlify.app',
},
];
return res.send({
type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE,
data: {
embeds: [
{
title: 'FlopoSite',
description: 'L\'officiel et très goatesque site de FlopoBot.',
color: 0x6571F3,
}
],
components: [
{
type: MessageComponentTypes.ACTION_ROW,
components: originalComponents,
},
],
}
})
}
if (name === 'search') {
const context = req.body.context;
// User ID is in user field for (G)DMs, and member for servers