diff --git a/dot-commands/gif.js b/dot-commands/gif.js index 18861d2..9aacfc5 100644 --- a/dot-commands/gif.js +++ b/dot-commands/gif.js @@ -22,7 +22,7 @@ module.exports = { `&key=${process.env.tenorAPIKey}` + '&limit=1' + `&contentfilter=off` - ).then(res => { + ).then(async (res) => { if (process.env.isDev) console.log(res.data.results); if (res.data.results[0] == undefined) { message.reply('Sorry I was unable to find a GIF of ' + commandData.args); @@ -33,10 +33,10 @@ module.exports = { // Handle when the invoking message is a reply to someone else if (message.reference) { // Fetch the referenced message from the channels' MessageManager - await message.channel.messages.fetch(message.reference.messageId).then((refMsg) => { + await message.channel.messages.fetch(message.reference.messageId).then(async (refMsg) => { // Send the reply to the referenced message await refMsg.reply(commandData.embed_url); - }).catch((e) => { + }).catch(async (e) => { // Failed fetching the message from the channel, fallback to regular send console.error(e); await message.reply(commandData.embed_url);