eris-message-collector
v1.0.5
Published
Allows you to use a message collector with the Eris Discord library
Downloads
16
Readme
eris-message-collector |
Makes collecting messages using the Eris librarier way easier!
Installation
npm i eris-message-collector
Usage
/* 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()
Contact me for help!
License
Refer to the License file.