sheweny
Version:
The powerful framework for create discord bots
65 lines (64 loc) • 1.78 kB
TypeScript
import { BaseStructure } from './index.js';
import { ShewenyError } from '../helpers/index.js';
import type { EventEmitter } from 'events';
import type { ShewenyClient } from '../client/Client.js';
import type { EventData, Awaitable } from '../typescript/index.js';
/**
* Represents an Event structure
* @extends {BaseStructure}
*/
export declare abstract class Event extends BaseStructure {
/**
* Description of a event
* @type {string}
*/
description: string;
/**
* Set the emitter of the event
* @type {EventEmitter}
*/
emitter: EventEmitter;
/**
* Name of a event
* @type {string}
*/
name: string;
/**
* If the listener is deleted after it is executed
* @type {boolean}
*/
once: boolean;
/**
* Constructor for build a Event
* @param {ShewenyClient} [client] Client framework
* @param {string} [name] Name of the event
* @param {EventData | undefined} [options] Custom id for one or more buttons
*/
constructor(client: ShewenyClient, name: string, options?: EventData);
before?(...args: unknown[]): Awaitable<unknown>;
/**
* Execute the events
* @param {any} args
*/
abstract execute(...args: unknown[]): Awaitable<unknown>;
/**
* Register an event
* @public
* @async
* @returns {Promise<Event | ShewenyError>} The loaded event
*/
register(): Promise<Event | ShewenyError>;
/**
* Reload an event
* @public
* @async
* @returns {Promise<Collection<string, Event> | ShewenyError>} The events collection
*/
reload(): Promise<Event | ShewenyError>;
/**
* Unregister an event
* @public
* @returns {boolean}
*/
unregister(): boolean;
}