UNPKG

@confis/discordapiwrapper

Version:

A fast and lightweight discord api wrapper.

77 lines (76 loc) 2.17 kB
import { Client, ComponentTypes } from "../client"; import { Interaction, ModalInteraction } from "./Interactions"; import { Message } from "./Message"; type COLLECTOR_EVENTS = "collect" | "end"; /** Collector object */ export declare class Collector { private timer; private client; private listeners; type: ComponentTypes[]; messageID: string; timeout?: number; filter?: (i: Interaction) => boolean; constructor(message: Message, client: Client, options?: { timeout?: number; component_type?: ComponentTypes[]; filter?: (i: Interaction) => boolean; }); /** * Listen for events * @param event Event name * @param callback The event callback */ on(event: COLLECTOR_EVENTS, callback: (...args: any[]) => any): void; /** * End the collector and execute the end event */ end(): void; /** * Reset the collector's timer */ resetTimer(): void; off(event: COLLECTOR_EVENTS): void; /** * Emit an event * @param event Event name * @param type Component type * @param args Event arguments */ emit(event: COLLECTOR_EVENTS, type: ComponentTypes, ...args: any[]): void; } /** Modal collector object */ export declare class ModalCollector { private timer; private client; private listeners; customID: string; timeout?: number; filter?: (i: ModalInteraction) => boolean; constructor(customID: string, client: Client, options?: { timeout?: number; filter?: (i: ModalInteraction) => boolean; }); /** * Listen for events * @param event Event name * @param callback The event callback */ on(event: COLLECTOR_EVENTS, callback: (i: ModalInteraction) => any): void; /** * End the collector and execute the end event */ end(): void; /** * Reset the collector's timer */ resetTimer(): void; off(event: COLLECTOR_EVENTS): void; /** * Emit an event * @param event Event name * @param args Event arguments */ emit(event: COLLECTOR_EVENTS, interaction: ModalInteraction): void; } export {};