So, here is what I envisioned, I made a simple message collector and I want the bot to collect files and then save them in its own folder, I am new to discord.js and I am most probably doing it wrong It would be of great help if I get an answer with some code example
.
client.on('message', inspire);
function inspire(msg) {
if (msg.content === '?create') {
msg.channel.send('Inspire me...');
let filter = m => !m.author.bot;
let collector = new Discord.MessageCollector(msg.channel, filter);
collector.on('collect', colMessage);
function colMessage(msg) {
console.log('Feeling inspired with ' + msg.content);
if (msg.content === "?enough") {
collector.stop();
}
}
collector.on('end', overWith => {
console.log('Was inspired by ' + overWith.size + ' messages');
const painter = Math.floor(Math.random() * artists.length);
msg.channel.send('Here is your ' + artists[painter] + ':');
// Artist is an array of famous painters' names, which is just there for the bot to do a funny comparison of the image it is going to send back (which is a filtered version of the image I want to download) with a masterpiece.
});
}
}