Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#54218 [@types/node-telegram-bot-api] Added…
Browse files Browse the repository at this point in the history
… types for editMessageMedia function by @toniop99
  • Loading branch information
toniop99 authored Jul 2, 2021
1 parent 53d2549 commit 223be8c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions types/node-telegram-bot-api/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// Michael Orlov <https://github.com/MiklerGM>
// Alexander Ariutin <https://github.com/ariutin>
// XieJiSS <https://github.com/XieJiSS>
// Toniop <https://github.com/toniop99>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

Expand Down Expand Up @@ -298,6 +299,13 @@ declare namespace TelegramBot {
inline_message_id?: string;
}

interface EditMessageMediaOptions {
chat_id?: number | string;
message_id?: number;
inline_message_id?: string;
reply_markup?: InlineKeyboardMarkup;
}

interface GetUserProfilePhotosOptions {
offset?: number;
limit?: number;
Expand Down Expand Up @@ -1179,6 +1187,8 @@ declare class TelegramBot extends EventEmitter {

editMessageCaption(caption: string, options?: TelegramBot.EditMessageCaptionOptions): Promise<TelegramBot.Message | boolean>;

editMessageMedia(media: TelegramBot.InputMedia, options: TelegramBot.EditMessageMediaOptions): Promise<TelegramBot.Message | boolean>;

editMessageReplyMarkup(replyMarkup: TelegramBot.InlineKeyboardMarkup, options?: TelegramBot.EditMessageReplyMarkupOptions): Promise<TelegramBot.Message | boolean>;

getUserProfilePhotos(userId: number | string, options?: TelegramBot.GetUserProfilePhotosOptions): Promise<TelegramBot.UserProfilePhotos>;
Expand Down
9 changes: 9 additions & 0 deletions types/node-telegram-bot-api/node-telegram-bot-api-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ MyTelegramBot.answerCallbackQuery('432832');
MyTelegramBot.answerCallbackQuery({ callback_query_id: '432832' });
MyTelegramBot.editMessageText('test-text', { disable_web_page_preview: true });
MyTelegramBot.editMessageCaption('My Witty Caption', { message_id: 1245 });
MyTelegramBot.editMessageMedia({
media: 'photo/path',
type: 'photo',
caption: 'this is a test',
parse_mode: 'HTML'
}, {
chat_id: 1234,
message_id: 9187231
});
MyTelegramBot.editMessageReplyMarkup({ inline_keyboard: [[{
text: 'Foo'
}]] }, { message_id: 1244 });
Expand Down

0 comments on commit 223be8c

Please sign in to comment.