# oceanic-collector

> A collection of Oceanic.js collectors

Latest version **2.0.0** (published 2026-05-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install oceanic-collector
pnpm add oceanic-collector
yarn add oceanic-collector
bun add oceanic-collector
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2026-05-30 |
| First published | 2023-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 53.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | catplusplus |

## Links

- npm: https://www.npmjs.com/package/oceanic-collector
- Repository: https://github.com/catplvsplus/oceanic-collector
- npm.io page: https://npm.io/package/oceanic-collector

## Dependencies (2)

- [@discordjs/collection](https://npm.io/package/@discordjs/collection.md) ^2.1.1
- [@vladfrangu/async_event_emitter](https://npm.io/package/@vladfrangu/async_event_emitter.md) ^2.4.7

## Recent versions

- 2.0.0 (latest) — 2026-05-30
- 1.0.3 — 2023-04-23
- 1.0.2 — 2023-03-17
- 1.0.1 — 2023-03-17
- 1.0.0 — 2023-03-17

## README

# Oceanic Collector
A collection of oceanic.js collectors

## Installation
```bash
npm install oceanic-collector
```

## Usage
### InteractionCollector
```ts
import { InteractionCollector } from 'oceanic-collector';

const collector = new InteractionCollector({
    client,                                      // Your oceanic.js client instance (required)
    time: 60000,                                 // Collect interactions for 60 seconds
    idle: 30000,                                 // End the collector if it becomes idle for 30 seconds
    max: 10,                                     // Collect a maximum of 10 interactions
    maxUsers: 5,                                 // Collect interactions from a maximum of 5 users
    types: [InteractionTypes.MESSAGE_COMPONENT], // Only collect a specific type of interaction
    filter: i => i.user.id === '1234567890',     // Only collect interactions from a specific user
    message,                                     // Only collect interactions from a specific message
    channel,                                     // Only collect interactions from a specific channel
    guild,                                       // Only collect interactions from a specific guild
});

collector.on('collect', interaction => {});      // Handle collected interactions
collector.on('end', (collected, reason) => {});  // Handle the end of the collection

collector.stop();                                // Stop the collector
```

### MessageCollector
```ts
import { MessageCollector } from 'oceanic-collector';

const collector = new MessageCollector({
    client,                                        // Your oceanic.js client instance (required)
    time: 60000,                                   // Collect messages for 60 seconds
    idle: 30000,                                   // End the collector if it becomes idle for 30 seconds
    max: 10,                                       // Collect a maximum of 10 messages
    filter: msg => msg.author.id === '1234567890', // Only collect messages from a specific user
    channel,                                       // Only collect messages from a specific channel
    guild,                                         // Only collect messages from a specific guild
});

collector.on('collect', message => {});            // Handle collected messages
collector.on('end', (collected, reason) => {});    // Handle the end of the collection

collector.stop();                                  // Stop the collector
```

### ReactionCollector
```ts
import { ReactionCollector } from 'oceanic-collector';

const collector = new ReactionCollector({
    client,                                               // Your oceanic.js client instance (required)
    time: 60000,                                          // Collect reactions for 60 seconds
    idle: 30000,                                          // End the collector if it becomes idle for 30 seconds
    max: 10,                                              // Collect a maximum of 10 reactions
    maxEmojis: 5,                                         // Collect a maximum of 5 different emojis
    maxUsers: 3,                                          // Collect reactions from a maximum of 3 users
    filter: (reaction, user) => user.id === '1234567890', // Only collect reactions from a specific user
    message,                                              // Only collect reactions from a specific message
    channel,                                              // Only collect reactions from a specific channel
    guild,                                                // Only collect reactions from a specific guild
});

collector.on('collect', reaction => {});                  // Handle collected reactions
collector.on('end', (collected, reason) => {});           // Handle the end of the collection

collector.stop();                                         // Stop the collector
```

---
_Source: https://npm.io/package/oceanic-collector · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
