Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

GodyFromDiscord/eris-message-collector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is outdated and no longer updated.

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.

About

A message collector for the Discord library Eris

Resources

License

Stars

Watchers

Forks

Packages

No packages published