on events type declaration

This commit is contained in:
mmacierzanka committed 2021-07-05 21:10:45 +02:00
1 parent 6cd71bbf31
commit 9ac0fa7fdd
2 files changed
+10 -3

No files matched your search

+9
View File
@@ -12,6 +12,15 @@ import { SystemMessageManager } from "./SystemMessage.js";
import { EventEmitter } from "events"; import { EventEmitter } from "events";
//TYPE DEFINITIONS //TYPE DEFINITIONS
export declare interface Bot {
on(event: "ready", listener: Function): this;
on(event: "message", listener: (m: Message) => void): this;
on(
event: "command",
listener: (m: Message, cmdMsg: CommandMessageStructure) => void
): this;
on(event: "error", listener: (e: any) => void): this;
}
interface ConfigurationOptions { interface ConfigurationOptions {
token?: string; token?: string;
helpCommand: boolean; helpCommand: boolean;
+1 -3
View File
@@ -34,7 +34,7 @@ interface PhraseOccurrenceData {
type: "NAME" | "ALIAS"; type: "NAME" | "ALIAS";
} }
//ERROR CLASSES //CLASSES
export class PermissionsError { export class PermissionsError {
private command: Command; private command: Command;
private user: GuildMember | null; private user: GuildMember | null;
@@ -46,8 +46,6 @@ export class PermissionsError {
return `User ${this.user?.user.tag} doesn't have enough permissions to run "${this.command.name}" command`; return `User ${this.user?.user.tag} doesn't have enough permissions to run "${this.command.name}" command`;
} }
} }
//CLASSES
export class Command { export class Command {
name: string; name: string;
aliases: string[]; aliases: string[];