From 8e881d2b9611a3786db6f5e95f25439e0a82f22c Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Thu, 11 Nov 2021 20:08:28 +0200 Subject: [PATCH] types: unify ApplicationCommandManager#create overloads (#6970) --- typings/index.d.ts | 3 +-- typings/tests.ts | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/typings/index.d.ts b/typings/index.d.ts index 2c93e2475..d79e51123 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -2643,8 +2643,7 @@ export class ApplicationCommandManager< null >; private commandPath({ id, guildId }: { id?: Snowflake; guildId?: Snowflake }): unknown; - public create(command: ApplicationCommandDataResolvable): Promise; - public create(command: ApplicationCommandDataResolvable, guildId: Snowflake): Promise; + public create(command: ApplicationCommandDataResolvable, guildId?: Snowflake): Promise; public delete(command: ApplicationCommandResolvable, guildId?: Snowflake): Promise; public edit( command: ApplicationCommandResolvable, diff --git a/typings/tests.ts b/typings/tests.ts index fe494f5d6..f132aff7b 100644 --- a/typings/tests.ts +++ b/typings/tests.ts @@ -794,7 +794,8 @@ declare const applicationCommandManager: ApplicationCommandManager; type ApplicationCommandScope = ApplicationCommand<{ guild: GuildResolvable }>; assertType>(applicationCommandManager.create(applicationCommandData)); - assertType>(applicationCommandManager.create(applicationCommandData, '0')); + assertType>(applicationCommandManager.create(applicationCommandData, '0')); + assertType>(applicationCommandManager.create(applicationCommandData, undefined)); assertType>( applicationCommandManager.edit(applicationCommandResolvable, applicationCommandData), );