mirror of
https://github.com/cassoule/flopobot_v2.git
synced 2026-01-18 16:37:40 +01:00
floposite command
This commit is contained in:
10
commands.js
10
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);
|
||||
|
||||
30
index.js
30
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
|
||||
|
||||
Reference in New Issue
Block a user