eris-collect
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Eris-Collect

A message, reaction, interaction collector for Eris. (supports v17.x)

This package is a modified version of Oceanic-Collectors to fit with eris.

If you face any problems, join our discord server (english, korean) for help.

Installing

You need NodeJS 16.16.0+.

npm install eris-collect

Message Collector Example

const { MessageCollector } = require('eris-collect')

const filter = (message) => message.author.id === 'UserID'
const collector = new MessageCollector(client, channel, { filter, time: 60_000 }) // time in ms

collector.on('collect', (message) => {
    console.log(message)
})

collector.on('end', (collectedMessages) => {
    console.log(collectedMessages.length)
})

awaitMessages Example

const { awaitMessages } = require('eris-collect')

const filter = (message) => message.author.id === 'ANY USER ID'
const messages = await awaitMessages(client, channel, { filter, max: 2, time: 60_000 }) // time in ms

console.log(messages.length)

Interaction Collector Example

const { InteractionCollector } = require('eris-collect')

// Return if Interaction was created in DM
// if (!interaction.guildID) return

const filter = (interaction) => interaction.member.id === 'UserID'
const collector = new InteractionCollector(client, channel, { filter, time: 60_000 }) // time in ms

collector.on('collect', (interaction) => {
    console.log(interaction)
})

collector.on('end', (collectedInteractions) => {
    console.log(collectedInteractions.length)
})

awaitComponentInteractions Example

const { awaitComponentInteractions } = require('eris-collect')

// Return if Interaction was created in DM
// if (!interaction.guildID) return

const filter = (interaction) => interaction.member.id === 'UserID'
const collectedInteractions = await awaitComponentInteractions(client, channel, { filter, max: 5, time: 30_000 }) // time in ms

console.log(collectedInteractions.length)

Package Sidebar

Install

npm i eris-collect

Weekly Downloads

0

Version

1.1.1

License

Apache-2.0

Unpacked Size

111 kB

Total Files

24

Last publish

Collaborators

  • manbo