[node-telegram-bot-api] Add parse_mode for files (#43839)

This commit is contained in:
Michael Orlov 2020-04-15 05:32:43 +02:00 committed by GitHub
parent b2a5c56a28
commit 1a2229b7cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -6,6 +6,7 @@
// Kallu609 <https://github.com/Kallu609>
// XC-Zhang <https://github.com/XC-Zhang>
// AdityaThebe <https://github.com/adityathebe>
// Michael Orlov <https://github.com/MiklerGM>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@ -143,10 +144,12 @@ declare namespace TelegramBot {
}
interface SendPhotoOptions extends SendBasicOptions {
parse_mode?: ParseMode;
caption?: string;
}
interface SendAudioOptions extends SendBasicOptions {
parse_mode?: ParseMode;
caption?: string;
duration?: number;
performer?: string;
@ -154,6 +157,7 @@ declare namespace TelegramBot {
}
interface SendDocumentOptions extends SendBasicOptions {
parse_mode?: ParseMode;
caption?: string;
}
@ -165,6 +169,7 @@ declare namespace TelegramBot {
type SendStickerOptions = SendBasicOptions;
interface SendVideoOptions extends SendBasicOptions {
parse_mode?: ParseMode;
duration?: number;
width?: number;
height?: number;
@ -172,6 +177,7 @@ declare namespace TelegramBot {
}
interface SendVoiceOptions extends SendBasicOptions {
parse_mode?: ParseMode;
caption?: string;
duration?: number;
}

View File

@ -29,12 +29,17 @@ const res: TelegramBot.InlineQueryResultArticle = {
MyTelegramBot.answerInlineQuery('queryId', [res, res, res], { is_personal: true });
MyTelegramBot.forwardMessage(1234, 5678, 'memberID', { disable_notification: true });
MyTelegramBot.sendPhoto(1234, 'photo/path', { caption: 'Foo' });
MyTelegramBot.sendPhoto(1234, 'photo/path', { caption: 'Foo', parse_mode: 'HTML' });
MyTelegramBot.sendAudio(1234, 'audio/path', { caption: 'Foo' });
MyTelegramBot.sendAudio(1234, 'audio/path', { caption: 'Foo', parse_mode: 'Markdown' });
MyTelegramBot.sendDocument(1234, 'doc/path', { caption: 'Foo' }, { fileOption: true });
MyTelegramBot.sendDocument(1234, 'doc/path', { caption: 'Foo', parse_mode: 'HTML' }, { fileOption: true });
MyTelegramBot.sendSticker(1234, 'sticker/path', { reply_to_message_id: 5678 });
MyTelegramBot.sendVideo(1234, 'video/path', { caption: 'Foo' });
MyTelegramBot.sendVideo(1234, 'video/path', { caption: 'Foo', parse_mode: 'MarkdownV2' });
MyTelegramBot.sendVideoNote(1234, 'video/path', { disable_notification: true });
MyTelegramBot.sendVoice(1234, 'voice/path', { caption: 'Foo' });
MyTelegramBot.sendVoice(1234, 'voice/path', { caption: 'Foo', parse_mode: 'HTML' });
MyTelegramBot.sendChatAction(1234, 'typing');
MyTelegramBot.kickChatMember(1234, 'myUserID');
MyTelegramBot.unbanChatMember(1234, 'myUserID');