fix(applicationcommandmanager): explicitly allow passing builders to methods (v13)

v13.9 #8229
This commit is contained in:
March 7th
2022-07-06 19:40:11 +07:00
parent 0e50134def
commit 1a656854c0
2 changed files with 31 additions and 9 deletions

15
typings/index.d.ts vendored
View File

@@ -3,13 +3,16 @@ import {
bold,
channelMention,
codeBlock,
ContextMenuCommandBuilder,
formatEmoji,
hideLinkEmbed,
hyperlink,
inlineCode,
italic,
JSONEncodable,
quote,
roleMention,
SlashCommandBuilder,
spoiler,
strikethrough,
time,
@@ -3208,7 +3211,11 @@ export abstract class CachedManager<K, Holds, R> extends DataManager<K, Holds, R
private _add(data: unknown, cache?: boolean, { id, extras }?: { id: K; extras: unknown[] }): Holds;
}
export type ApplicationCommandDataResolvable = ApplicationCommandData | RESTPostAPIApplicationCommandsJSONBody;
export type ApplicationCommandDataResolvable =
| ApplicationCommandData
| RESTPostAPIApplicationCommandsJSONBody
| SlashCommandBuilder
| ContextMenuCommandBuilder;
export class ApplicationCommandManager<
ApplicationCommandScope = ApplicationCommand<{ guild: GuildResolvable }>,
@@ -3251,9 +3258,7 @@ export class ApplicationCommandManager<
commands: ApplicationCommandDataResolvable[],
guildId: Snowflake,
): Promise<Collection<Snowflake, ApplicationCommand>>;
private static transformCommand(
command: ApplicationCommandData,
): Omit<APIApplicationCommand, 'id' | 'application_id' | 'guild_id'>;
private static transformCommand(command: ApplicationCommandDataResolvable): RESTPostAPIApplicationCommandsJSONBody;
}
export class ApplicationCommandPermissionsManager<
@@ -3369,7 +3374,7 @@ export class GuildApplicationCommandManager extends ApplicationCommandManager<Ap
public delete(command: ApplicationCommandResolvable): Promise<ApplicationCommand | null>;
public edit(
command: ApplicationCommandResolvable,
data: ApplicationCommandDataResolvable,
data: Partial<ApplicationCommandDataResolvable>,
): Promise<ApplicationCommand>;
public fetch(id: Snowflake, options?: FetchGuildApplicationCommandFetchOptions): Promise<ApplicationCommand>;
public fetch(options: FetchGuildApplicationCommandFetchOptions): Promise<Collection<Snowflake, ApplicationCommand>>;