From be83b9ea749e6d788cf118478766754335ce2d92 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Wed, 25 Sep 2024 18:56:33 -0400 Subject: [PATCH] WIP --- CustomModules/Embeds.js | 28 ++++++++++++++++++++++++++++ slash-commands/save.js | 12 ++---------- 2 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 CustomModules/Embeds.js diff --git a/CustomModules/Embeds.js b/CustomModules/Embeds.js new file mode 100644 index 0000000..6335690 --- /dev/null +++ b/CustomModules/Embeds.js @@ -0,0 +1,28 @@ +module.exports = { + gifSearchAR() { + // Setup the buttons + const previousButton = new MessageButton() + .setCustomId('prevGif') + .setLabel('⬅️') + .setStyle('SECONDARY'); + + const confirmButton = new MessageButton() + .setCustomId('confirmGif') + .setLabel('✅') + .setStyle('PRIMARY'); + + const nextButton = new MessageButton() + .setCustomId('nextGif') + .setLabel('➡️') + .setStyle('SECONDARY'); + + const cancelButton = new MessageButton() + .setCustomId('cancelGif') + .setLabel('❌') + .setStyle('DANGER'); + + // Put the buttons into an ActionRow + return new MessageActionRow() + .addComponents(previousButton, confirmButton, nextButton, cancelButton); + } +} \ No newline at end of file diff --git a/slash-commands/save.js b/slash-commands/save.js index b47b05d..28f7533 100644 --- a/slash-commands/save.js +++ b/slash-commands/save.js @@ -11,6 +11,7 @@ const { MessageActionRow, MessageButton } = require('discord.js'); const fn = require('../functions.js'); const strings = require('../strings.json'); const { GifData } = require('../CustomModules/NodBot.js'); +const customEmbeds = require('../CustomModules/Embeds.js'); const { emoji } = strings; module.exports = { @@ -142,16 +143,7 @@ module.exports = { // GIF Search case "gifsearch": // TODO Check on option names - // Previous GIF button - const prevButton = new MessageButton().setCustomId('prevGif').setLabel('Previous GIF').setStyle('SECONDARY').setDisabled(true); - // Confirm GIF Button - const confirmButton = new MessageButton().setCustomId('confirmGif').setLabel('Confirm').setStyle('PRIMARY'); - // Next GIF Button - const nextButton = new MessageButton().setCustomId('nextGif').setLabel('Next GIF').setStyle('SECONDARY'); - // Cancel Button - const cancelButton = new MessageButton().setCustomId('cancelGif').setLabel('Cancel').setStyle('DANGER'); - // Put all the above into an ActionRow to be sent as a component of the reply - const actionRow = new MessageActionRow().addComponents(prevButton, confirmButton, nextButton, cancelButton); + const actionRow = customEmbeds.gifSearchAR(); // Get the query const query = interaction.options.getString('query');