Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
How do I specify the dimensions of the video (height, width) when sending telegrams by bot?

I use the node-telegram-bot-api library. How do I specify the size of the video when sending it?

// where to specify height and width ?
bot.sendVideo(
  chatId,
  video,
  { caption: 'my video' },
  { filename: 'my_file' }, 
)

The telegram API allows you to specify sizes, but it seems to me that the sendVideo method does not allow you to specify them. Is it so?

p.s.: I tried to pass height and width through the option argument.

bot.sendVideo(
    chatId,
    `video`,
    {
        caption: 'my video',
        height: 720,
        width: 1280
    },
    {filename:'my_file'}
)
    .then(res=>{console.log(res)})

but with any parameters of the height and width parameters, I get the same answer.

video: {
    duration: 8,
    width: 1080,
    height: 1920,
    file_name: 'my_video',
    mime_type: 'video/mp4',
    thumb: {
      file_id: '***',
      file_unique_id: '***',
      file_size: 12743,
      width: 180,
      height: 320
    },
    file_id: '***',
    file_unique_id: '***',
    file_size: 4938678
  },

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you check the node-telegram-bot-api library's GitHub repo, you can see that the sendVideo() method accepts an options object as the third parameter that stores additional Telegram query options.

You're already passing down an object with a caption key and you could add some more there, like height, width, duration, etc. A complete list of these options is available on the Telegram docs.

bot.sendVideo(
  chatId,
  video,
  {
    caption: 'my video',
    height: 720,
    width: 1280,
  },
  { filename: 'my_file' }, 
)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!