diff --git a/commands.js b/commands.js index 056838f..bde553a 100644 --- a/commands.js +++ b/commands.js @@ -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); diff --git a/index.js b/index.js index 3142a58..ab6ec60 100644 --- a/index.js +++ b/index.js @@ -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