Skip to main content
Very Popular
Go to Latest
variable InputMediaBuilder
import { InputMediaBuilder } from "";

Holds a number of helper methods for building InputMedia* objects. They are useful when sending media groups and when editing media messages.

For example, media groups can be sent like this.

const paths = [
const files = => new InputFile(path))
const media = =>
await bot.api.sendMediaGroup(chatId, media)

Media can be edited like this.

const file = new InputFile('/tmp/pic0.jpg')
const media =, {
    caption: 'new caption'
await bot.api.editMessageMedia(chatId, messageId, media)


{ photo(media: string | InputFile, options?: InputMediaOptions<InputMediaPhoto>): InputMediaPhoto; video(media: string | InputFile, options?: InputMediaOptions<InputMediaVideo>): InputMediaVideo; animation(media: string | InputFile, options?: InputMediaOptions<InputMediaAnimation>): InputMediaAnimation; audio(media: string | InputFile, options?: InputMediaOptions<InputMediaAudio>): InputMediaAudio; document(media: string | InputFile, options?: InputMediaOptions<InputMediaDocument>): InputMediaDocument; }