Skip to content

Commit

Permalink
fix(typings): telegram.edit args correct types
Browse files Browse the repository at this point in the history
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
  • Loading branch information
EdJoPaTo committed Jun 2, 2020
1 parent 84d11f5 commit a8c6a34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions typings/context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export declare class TelegrafContext {
* @param markup Markup of inline keyboard
*/
editMessageCaption(
caption?: string,
caption: string | undefined,
markup?: tt.InlineKeyboardMarkup
): Promise<tt.Message | boolean>

Expand All @@ -435,7 +435,7 @@ export declare class TelegrafContext {
* @param markup Markup of inline keyboard
*/
editMessageReplyMarkup(
markup?: tt.InlineKeyboardMarkup
markup: tt.InlineKeyboardMarkup | undefined
): Promise<tt.Message | boolean>

/**
Expand Down
6 changes: 3 additions & 3 deletions typings/telegram.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<tt.Message | boolean>

/**
Expand All @@ -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<tt.Message | boolean>

/**
Expand Down

0 comments on commit a8c6a34

Please sign in to comment.