Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

227
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda