Hotfix 2.1

This commit is contained in:
ZyLacx 2022-02-12 14:35:16 +01:00
parent da924b9cd5
commit 3968836758
3 changed files with 17 additions and 12 deletions

4
.gitignore vendored
View file

@ -1,7 +1,7 @@
.env .env
.eslintignore .eslintignore
.eslintrc.json .eslintrc.json
debug.js
deploy-guild-commands.js deploy-guild-commands.js
MOOver.code-workspace MOOver.code-workspace
allCode.js allCode.js
debug.js

View file

@ -34,12 +34,12 @@ async function getGifEmbed(options) {
} }
catch { catch {
const gifs = `https://g.tenor.com/v1/random?key=${process.env.TENOR}&limit=${gifAmount}&contentfilter=${rating}`; 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 searchSplits = search.split(/[ ]+/);
const searchKey = searchSplits.join('-'); const searchKey = searchSplits.join('-');
const gifs = `https://g.tenor.com/v1/search?q=${searchKey}&key=${process.env.TENOR}&limit=${gifAmount}&contentfilter=${rating}`; 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);
} }

21
main.js
View file

@ -144,7 +144,7 @@ function move(message, channelId) {
if (msg.embeds.length > 0) { if (msg.embeds.length > 0) {
client.channels.cache.get(mentionedChannelId) 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 { else {
client.channels.cache.get(mentionedChannelId) client.channels.cache.get(mentionedChannelId)
@ -154,13 +154,18 @@ function move(message, channelId) {
else { else {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setColor(help.randomColor()) .setColor(help.randomColor())
.addField('MOO', `Sent by ${msg.author}\nmooved ${message.author}`) .addField('MOO', `Sent by ${msg.author}\nmooved ${message.author}`);
.addField( if (msg.content.includes('http')) {
'Message:', msg.content); const file = new MessageAttachment(msg.content);
client.channels.cache.get(mentionedChannelId).send({ client.channels.cache.get(mentionedChannelId).send({
embeds: [embed], embeds: [embed], files: [file] });
}); }
} else {
embed.addField('Message:', msg.content);
client.channels.cache.get(mentionedChannelId).send({
embeds: [embed] });
}
}
setTimeout(() => msg.delete(), 3000); setTimeout(() => msg.delete(), 3000);
}); });
setTimeout(() => message.delete(), 3000); setTimeout(() => message.delete(), 3000);