diff --git a/typings/index.d.ts b/typings/index.d.ts index 92be695ef..71b78d27f 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -279,7 +279,6 @@ export type GuildCacheMessage = CacheTypeReducer< export abstract class BaseCommandInteraction extends Interaction { public options: CommandInteractionOptionResolver; public readonly command: ApplicationCommand | ApplicationCommand<{ guild: GuildResolvable }> | null; - public readonly channel: TextBasedChannels | null; public channelId: Snowflake; public commandId: Snowflake; public commandName: string; @@ -1077,7 +1076,7 @@ export class Interaction extends Base { private readonly _cacheType: Cached; protected constructor(client: Client, data: RawInteractionData); public applicationId: Snowflake; - public channel: CacheTypeReducer; + public readonly channel: CacheTypeReducer; public channelId: Snowflake | null; public readonly createdAt: Date; public readonly createdTimestamp: number; @@ -2547,6 +2546,7 @@ export class ApplicationCommandManager< id: Snowflake, options: FetchApplicationCommandOptions & { guildId: Snowflake }, ): Promise; + public fetch(options: FetchApplicationCommandOptions): Promise>; public fetch(id: Snowflake, options?: FetchApplicationCommandOptions): Promise; public fetch( id?: Snowflake, @@ -2629,6 +2629,7 @@ export class GuildApplicationCommandManager extends ApplicationCommandManager; public fetch(id: Snowflake, options?: BaseFetchOptions): Promise; + public fetch(options: BaseFetchOptions): Promise>; public fetch(id?: undefined, options?: BaseFetchOptions): Promise>; public set(commands: ApplicationCommandDataResolvable[]): Promise>; } diff --git a/typings/tests.ts b/typings/tests.ts index b42294a6b..40de09e17 100644 --- a/typings/tests.ts +++ b/typings/tests.ts @@ -105,6 +105,12 @@ const guildCommandId = '234567890123456789'; // example id client.on('ready', async () => { console.log(`Client is logged in as ${client.user!.tag} and ready!`); + // Test fetching all global commands and ones from one guild + assertType>(await client.application!.commands.fetch()); + assertType>( + await client.application!.commands.fetch({ guildId: testGuildId }), + ); + // Test command manager methods const globalCommand = await client.application?.commands.fetch(globalCommandId); const guildCommandFromGlobal = await client.application?.commands.fetch(guildCommandId, { guildId: testGuildId });