Answer the question
In order to leave comments, you need to log in
How to properly implement message forwarding from a bot to a telegram channel?
I got an error. I don’t understand how to forward a message from a telegram bot to a channel. I'm using telegraf.js After sending the first message, I want to send the second, and the first is forwarded. The first photo is the answers in the bot. The second photo is what comes into the channel.
The code that I have 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: `Смотреть`, url: 'https://www.instagram.com/' }],
[{ text: 'Телеграм 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: ,
},
});
};
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question