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

229
Views
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 answers
Answer question

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 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!