[node-telegram-bot-api] Added sendMediaGroup (#26066)

* Added sendMediaGroup

[sendMediaGroup](435f06319e/src/telegram.js (L1831-L1877)) doesn't seem to [work](https://github.com/yagop/node-telegram-bot-api/issues/492) currently but here are the typings for it.

* Typo in github domain

* Removed whitespace and added semicolon
This commit is contained in:
Kalle
2018-05-30 02:00:04 +03:00
committed by Mohamed Hegazy
parent faf3591869
commit 9ffa281e1b

View File

@@ -3,6 +3,7 @@
// Definitions by: Alex Muench <https://github.com/ammuench>
// Agadar <https://github.com/agadar>
// Giorgio Garasto <https://github.com/Dabolus>
// Kallu609 <https://github.com/Kallu609>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -109,6 +110,11 @@ declare namespace TelegramBot {
caption?: string;
}
interface SendMediaGroupOptions {
disable_notification?: boolean;
reply_to_message_id?: number;
}
type SendStickerOptions = SendBasicOptions;
interface SendVideoOptions extends SendBasicOptions {
@@ -355,6 +361,17 @@ declare namespace TelegramBot {
mime_type?: string;
}
interface InputMediaPhoto {
type: string;
media: string;
fileOptions?: {
filename: string;
contentType: string;
};
}
type InputMediaVideo = InputMediaPhoto;
interface VideoNote extends FileBase {
length: number;
duration: number;
@@ -835,6 +852,8 @@ declare class TelegramBot extends EventEmitter {
sendDocument(chatId: number | string, doc: string | Stream | Buffer, options?: TelegramBot.SendDocumentOptions, fileOpts?: any): Promise<TelegramBot.Message | Error>;
sendMediaGroup(chatId: number | string, media: Array<TelegramBot.InputMediaPhoto | TelegramBot.InputMediaVideo>, options?: TelegramBot.SendMediaGroupOptions): Promise<TelegramBot.Message | Error>;
sendSticker(chatId: number | string, sticker: string | Stream | Buffer, options?: TelegramBot.SendStickerOptions): Promise<TelegramBot.Message | Error>;
sendVideo(chatId: number | string, video: string | Stream | Buffer, options?: TelegramBot.SendVideoOptions): Promise<TelegramBot.Message | Error>;