diff --git a/main.js b/main.js index 2dd9a0a..7828b3b 100644 --- a/main.js +++ b/main.js @@ -107,18 +107,12 @@ client.on('interactionCreate', async interaction => { interaction.update(strings.temp.gifs[newIndex].embed_url); break; case 'confirmGif': - interaction.update({ content: 'GIF Confirmed, what should I save it as?\n(*don\'t* include the .gif)', components: [] }); - const collector = fn.collect.gifName(interaction); - collector.on('collect', m => { - const gifData = { - name: m.content.toLowerCase(), - embed_url: strings.temp.gifs[strings.temp.gifIndex].embed_url, - }; - fn.upload.gif(gifData, client); - m.reply(`I've saved the GIF as ${gifData.name}.gif`); - fn.download.gifs(interaction.client); - collector.stop('success'); - }); + const gifData = { + name: strings.temp.gifName, + embed_url: strings.temp.gifs[strings.temp.gifIndex].embed_url, + }; + fn.upload.gif(gifData, client); + interaction.update({ content: `I've saved the GIF as ${gifData.name}.gif`, components: [] }); fn.download.gifs(interaction.client); break; case 'nextGif': diff --git a/slash-commands/savegif.js b/slash-commands/savegif.js index aa2708c..c80fae3 100644 --- a/slash-commands/savegif.js +++ b/slash-commands/savegif.js @@ -18,6 +18,10 @@ module.exports = { .addStringOption(option => option.setName('query') .setDescription('Search Query') + .setRequired(true)) + .addStringOption(option => + option.setName('name') + .setDescription('What to save the gif as') .setRequired(true)), async execute(interaction) { // Previous GIF button @@ -33,6 +37,7 @@ module.exports = { // Get the query const query = interaction.options.getString('query'); + strings.temp.gifName = interaction.options.getString('name').toLowerCase(); // Search Tenor for the GIF tenor.Search.Query(query, '10').then(res => {