Skip to content

Nuckyz/oceanic-collectors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oceanic Collectors

Fully typed collectors for Oceanic.

Installing

You will need NodeJS 16.16.0+.

npm install oceanic-collectors

Message Collector Example

const { MessageCollector } = require('oceanic-collectors');

const filter = (message) => message.author.id === 'ANY USER ID';
const collector = new MessageCollector(client, channel, { filter, time: 60_000 });

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

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

awaitMessages Example

const { awaitMessages } = require('oceanic-collectors');

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

console.log(messages.length);

License

Refer to the LICENSE file.

About

Fully typed collectors for Oceanic.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published