Makes collecting messages using the Eris librarier way easier!
npm i eris-message-collector
/* Install/Import Eris Packages*/
const Eris = require("eris");
const client = new Eris("BOT_TOKEN");
/* Install/Import the Collector Package */
const { MessageCollector } = require('eris-message-collector');
client.on("ready", () => {
console.log("Bot is ready!")
})
client.on("messageCreate", async(message) => {
if (message.author.bot) return;
if (message.channel.type === 'dm') return;
if(message.content == "messageCollector"){
message.channel.createMessage("Hey! Go ahead and say \`Collect Me\`"); // Create our message prompting the user.
let filter = (m) => message.author.id === m.author.id && m.content === "Collect Me"; // Create our filter which looks for "Collect Me" from the message author.
const collector = new MessageCollector(client, message.channel, filter, { // Create our collector with our options set as the current channel, the client, filter and our time
time: 5000 * 15
});
collector.on("collect", (m) => { // If our filter is followed expect output should be the authors information.
console.log(m.author)
})
}
})
client.connect()
Refer to the License file.