diff --git a/mod.ts b/mod.ts index 1c1b1b0..33ffdfe 100644 --- a/mod.ts +++ b/mod.ts @@ -16,6 +16,7 @@ export { ChannelsManager } from './src/managers/channels.ts' export { EmojisManager } from './src/managers/emojis.ts' export { GatewayCache } from './src/managers/gatewayCache.ts' export { GuildChannelsManager } from './src/managers/guildChannels.ts' +export type { GuildChannel } from './src/managers/guildChannels.ts' export { GuildManager } from './src/managers/guilds.ts' export { GuildEmojisManager } from './src/managers/guildEmojis.ts' export { MembersManager } from './src/managers/members.ts' diff --git a/src/models/client.ts b/src/models/client.ts index 23ec8c9..e295fff 100644 --- a/src/models/client.ts +++ b/src/models/client.ts @@ -36,7 +36,7 @@ export interface ClientOptions { fetchUncachedReactions?: boolean } -export declare interface Client { +export interface ClientEventsEmitter { on: (event: U, listener: ClientEvents[U]) => this emit: ( @@ -84,6 +84,15 @@ export class Client extends EventEmitter { /** Client's presence. Startup one if set before connecting */ presence: ClientPresence = new ClientPresence() + private _untypedOn = this.on + private _untypedEmit = this.emit + public on = (event: K, listener: ClientEvents[K]): this => + this._untypedOn(event, listener) + public emit = ( + event: K, + ...args: Parameters + ): boolean => this._untypedEmit(event, ...args) + constructor(options: ClientOptions = {}) { super() this.token = options.token diff --git a/src/test/cmd.ts b/src/test/cmd.ts index 2530c83..ea2fec1 100644 --- a/src/test/cmd.ts +++ b/src/test/cmd.ts @@ -2,9 +2,9 @@ import { Command, CommandClient, Intents, - GuildChannel, CommandContext, - Extension + Extension, + GuildChannel } from '../../mod.ts' import { Invite } from '../structures/invite.ts' import { TOKEN } from './config.ts'