fixing errors

This commit is contained in:
= 2021-07-13 20:57:37 -04:00
parent 47725a7624
commit a09c83fa4e
2 changed files with 4 additions and 7 deletions

View File

@ -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}`));
}

View File

@ -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}`);