Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

237
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda