From a09c83fa4e03bab0396ae7c5c73867b0fd3a17bb Mon Sep 17 00:00:00 2001 From: = Date: Tue, 13 Jul 2021 20:57:37 -0400 Subject: [PATCH] fixing errors --- commands/gif.js | 8 +++----- functions.js | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/commands/gif.js b/commands/gif.js index d2c4dea..bfb3410 100644 --- a/commands/gif.js +++ b/commands/gif.js @@ -12,10 +12,9 @@ module.exports = { // message.channel.send(file.name + ' requested by ' + message.author.username + '\n' + res.data[0].embed_url).then().catch(console.error); const gifInfo = { 'name': file.name, - 'embed_url': res.data[0].images.original.url, - 'author': message.author, + 'embed_url': res.data[0].images.original.url }; - message.channel.send(functions.createGifEmbed(gifInfo)); + message.channel.send(functions.createGifEmbed(gifInfo, message.author, `${file.name}.${file.extension}`)); } else { message.channel.send('I was unable to find a gif of ' + file.name); } @@ -25,8 +24,7 @@ module.exports = { // message.channel.send(file.name + ' requested by ' + message.author.username + '\n' + client.gifs.get(file.name).embed_url); const gifInfo = { 'name': file.name, - 'embed_url': client.gifs.get(file.name).embed_url, - 'author': message.author, + 'embed_url': client.gifs.get(file.name).embed_url }; message.channel.send(functions.createGifEmbed(gifInfo, message.author, `${file.name}.${file.extension}`)); } diff --git a/functions.js b/functions.js index 7c5cc99..b835c68 100644 --- a/functions.js +++ b/functions.js @@ -47,8 +47,7 @@ module.exports = { }, createGifEmbed(data, author, command) { return new Discord.MessageEmbed() - .setAuthor('NodBot v2 - GIF') - .setTitle(command) + .setAuthor(command) .setImage(data.embed_url) .setTimestamp() .setFooter(`@${author.username}#${author.discriminator}`);