diff --git a/.gitignore b/.gitignore index a8c3fbd..d9e28b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .env .eslintignore .eslintrc.json +debug.js deploy-guild-commands.js MOOver.code-workspace -allCode.js -debug.js \ No newline at end of file +allCode.js \ No newline at end of file diff --git a/commands/gif.js b/commands/gif.js index 8620b38..bc78bf1 100644 --- a/commands/gif.js +++ b/commands/gif.js @@ -34,12 +34,12 @@ async function getGifEmbed(options) { } catch { const gifs = `https://g.tenor.com/v1/random?key=${process.env.TENOR}&limit=${gifAmount}&contentfilter=${rating}`; - return help.getGif(gifs, gifAmount); + return help.getGifEmbed(gifs, gifAmount); } const searchSplits = search.split(/[ ]+/); const searchKey = searchSplits.join('-'); const gifs = `https://g.tenor.com/v1/search?q=${searchKey}&key=${process.env.TENOR}&limit=${gifAmount}&contentfilter=${rating}`; - return help.getGif(gifs, gifAmount); + return help.getGifEmbed(gifs, gifAmount); } \ No newline at end of file diff --git a/main.js b/main.js index 726fb1c..5c28851 100755 --- a/main.js +++ b/main.js @@ -144,7 +144,7 @@ function move(message, channelId) { if (msg.embeds.length > 0) { client.channels.cache.get(mentionedChannelId) - .send({ content: `Sent by ${msg.author}\nmooved ${message.author}`, embeds: msg.embeds }); + .send({ content: `Sent by ${msg.author}\nmooved ${message.author}`, embeds: msg.embeds, files: newMsgAttachments }); } else { client.channels.cache.get(mentionedChannelId) @@ -154,13 +154,18 @@ function move(message, channelId) { else { const embed = new Discord.MessageEmbed() .setColor(help.randomColor()) - .addField('MOO', `Sent by ${msg.author}\nmooved ${message.author}`) - .addField( - 'Message:', msg.content); - client.channels.cache.get(mentionedChannelId).send({ - embeds: [embed], - }); - } + .addField('MOO', `Sent by ${msg.author}\nmooved ${message.author}`); + if (msg.content.includes('http')) { + const file = new MessageAttachment(msg.content); + client.channels.cache.get(mentionedChannelId).send({ + embeds: [embed], files: [file] }); + } + else { + embed.addField('Message:', msg.content); + client.channels.cache.get(mentionedChannelId).send({ + embeds: [embed] }); + } + } setTimeout(() => msg.delete(), 3000); }); setTimeout(() => message.delete(), 3000);