Update main.js

This commit is contained in:
ZyLacx 2022-02-12 14:19:44 +01:00
parent dc4c6509bf
commit da924b9cd5

14
main.js
View file

@ -40,7 +40,7 @@ client.once('ready', () => {
client.channels.cache.get('780439236867653635').send('Just turned on!'); client.channels.cache.get('780439236867653635').send('Just turned on!');
} }
console.log('Running!'); console.log('Running!');
refreshPings(); // refreshPings();
}); });
client.on('messageCreate', gotMessage); client.on('messageCreate', gotMessage);
@ -142,17 +142,21 @@ function move(message, channelId) {
newMsgAttachments.push(new MessageAttachment(currAttachment.url)); newMsgAttachments.push(new MessageAttachment(currAttachment.url));
} }
client.channels.cache.get(mentionedChannelId).send({ content: `Sent by ${msg.author}\nmooved ${message.author}`, files: newMsgAttachments });
}
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 });
} }
else {
client.channels.cache.get(mentionedChannelId)
.send({ content: `Sent by ${msg.author}\nmooved ${message.author}`, files: newMsgAttachments });
}
}
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('Message:', msg.content); .addField(
'Message:', msg.content);
client.channels.cache.get(mentionedChannelId).send({ client.channels.cache.get(mentionedChannelId).send({
embeds: [embed], embeds: [embed],
}); });
@ -170,6 +174,7 @@ async function whoAsked(message) {
message.reply({ embeds: [help.getGifEmbed(gifs, gifAmount)] }); message.reply({ embeds: [help.getGifEmbed(gifs, gifAmount)] });
} }
/**
async function pingEvent() { async function pingEvent() {
const currentDay = new Date().getDate(); const currentDay = new Date().getDate();
const currentMonth = new Date().getMonth(); const currentMonth = new Date().getMonth();
@ -249,5 +254,6 @@ async function refreshPings() {
await setTimeout(eventsCountdown, 12 * 60 * 60 * 100); await setTimeout(eventsCountdown, 12 * 60 * 60 * 100);
} }
} }
*/
client.login(process.env.TOKEN); client.login(process.env.TOKEN);