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

234
Vistas
How to properly implement the forwarding of a message from a bot to a telegram channel?

I have an error. I don't understand how to forward a message from a telegram bot to a channel. I use telegraf.js After sending the first message, I want to send the second one, and the first one is forwarded. The first photo is the answers in the bot. The second photo is what comes into the channel.

The code itself that I implemented:

bot.on('message', async (ctx) => {
  const getFilmId = await kinoInfo(ctx.message.text);
  const infoFilm = getFilmId.data.data;
  const id = infoFilm.filmId;

  const name = infoFilm.nameRu;

  ctx.reply(name, {
    reply_markup: {
      inline_keyboard: [
        [{ text: `Watch`, url: 'https://www.instagram.com/' }],
        [{ text: 'Telegram channel 1', callback_data: 'ONE' }],
      ],
    },
  });

  bot.on('callback_query', (ctx) => {
    const data = ctx.update.callback_query.data;
    if (data === 'ONE') {
      postToChannel(ctx);
    }
  });

  const postToChannel = (ctx) => {
    ctx.telegram.sendMessage('@fgdsfsdfsd', name, {
      parse_mode: 'html',
      reply_markup: {
        inline_keyboard: [[{ text: `Watch`, url: 'https://www.instagram.com/' }]],
      },
    });
  };
});

First photo

Second photo

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

use ForwardMessage() method in postToChannel function. and specify message_id I have a working solution of this. your welcome!

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