1.0.5 • Published 3 years ago

eris-message-collector v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

eris-message-collector | npm

Makes collecting messages using the Eris librarier way easier!

GitHub all releases GitHub forks GitHub Repo stars

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!

Discord

License

Refer to the License file.

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago