14 lines
339 B
TypeScript
14 lines
339 B
TypeScript
import { EventEmitter } from 'node:events'
|
|
import type { Interaction } from '@discordeno/bot'
|
|
|
|
export class ItemCollector extends EventEmitter {
|
|
onItem(callback: (item: Interaction) => unknown): void {
|
|
this.on('item', callback)
|
|
}
|
|
|
|
collect(item: Interaction): void {
|
|
this.emit('item', item)
|
|
}
|
|
}
|
|
|
|
export default ItemCollector |