From a8c6a34520b80945404a1af8bd255c87a36b6ebd Mon Sep 17 00:00:00 2001 From: EdJoPaTo Date: Tue, 2 Jun 2020 21:18:38 +0200 Subject: [PATCH] fix(typings): telegram.edit args correct types fix Markup type (correct on context) arguments can be undefined but they should be explicitly This way you state explicitly what you want and dont forget something. This way typescript can actually help you BREAKING CHANGE: you have to supply undefined where you could ommit the argument before --- typings/context.d.ts | 4 ++-- typings/telegram.d.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/typings/context.d.ts b/typings/context.d.ts index 7e029147f..5acdce55e 100644 --- a/typings/context.d.ts +++ b/typings/context.d.ts @@ -425,7 +425,7 @@ export declare class TelegrafContext { * @param markup Markup of inline keyboard */ editMessageCaption( - caption?: string, + caption: string | undefined, markup?: tt.InlineKeyboardMarkup ): Promise @@ -435,7 +435,7 @@ export declare class TelegrafContext { * @param markup Markup of inline keyboard */ editMessageReplyMarkup( - markup?: tt.InlineKeyboardMarkup + markup: tt.InlineKeyboardMarkup | undefined ): Promise /** diff --git a/typings/telegram.d.ts b/typings/telegram.d.ts index fe20680f3..f3143d2a4 100644 --- a/typings/telegram.d.ts +++ b/typings/telegram.d.ts @@ -137,8 +137,8 @@ export declare class Telegram extends ApiClient { chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, - caption: string, - markup: string + caption: string | undefined, + markup?: tt.InlineKeyboardMarkup ): Promise /** @@ -153,7 +153,7 @@ export declare class Telegram extends ApiClient { chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, - markup: string + markup: tt.InlineKeyboardMarkup | undefined ): Promise /**