mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
types: unify ApplicationCommandManager#create overloads (#6970)
This commit is contained in:
3
typings/index.d.ts
vendored
3
typings/index.d.ts
vendored
@@ -2643,8 +2643,7 @@ export class ApplicationCommandManager<
|
||||
null
|
||||
>;
|
||||
private commandPath({ id, guildId }: { id?: Snowflake; guildId?: Snowflake }): unknown;
|
||||
public create(command: ApplicationCommandDataResolvable): Promise<ApplicationCommandScope>;
|
||||
public create(command: ApplicationCommandDataResolvable, guildId: Snowflake): Promise<ApplicationCommand>;
|
||||
public create(command: ApplicationCommandDataResolvable, guildId?: Snowflake): Promise<ApplicationCommandScope>;
|
||||
public delete(command: ApplicationCommandResolvable, guildId?: Snowflake): Promise<ApplicationCommandScope | null>;
|
||||
public edit(
|
||||
command: ApplicationCommandResolvable,
|
||||
|
||||
@@ -794,7 +794,8 @@ declare const applicationCommandManager: ApplicationCommandManager;
|
||||
type ApplicationCommandScope = ApplicationCommand<{ guild: GuildResolvable }>;
|
||||
|
||||
assertType<Promise<ApplicationCommandScope>>(applicationCommandManager.create(applicationCommandData));
|
||||
assertType<Promise<ApplicationCommand>>(applicationCommandManager.create(applicationCommandData, '0'));
|
||||
assertType<Promise<ApplicationCommandScope>>(applicationCommandManager.create(applicationCommandData, '0'));
|
||||
assertType<Promise<ApplicationCommandScope>>(applicationCommandManager.create(applicationCommandData, undefined));
|
||||
assertType<Promise<ApplicationCommandScope>>(
|
||||
applicationCommandManager.edit(applicationCommandResolvable, applicationCommandData),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user