Answer the question
In order to leave comments, you need to log in
Hello, I want to write a bot that can forward a message from a closed telegram channel?
The bot will be the administrator of a private channel, from which messages will be sent to a private chat with the user. I use TelegramBotAPI, I wanted to use the forwardMessage method, but I don't know how to get the id of the message to be sent.
Answer the question
In order to leave comments, you need to log in
I so understand it is necessary to forward all new messages in the channel to the list of users?
In order for the bot to see channel updates, you must make it an administrator for that channel. Other channels cannot be read by a bot.
And then do something like this:
@bot.channel_post_handler(content_types=['text','photo','audio','video','document'])
def process_channel_message(message):
for chat_id in array_of_your_user_chat_ids:
bot.forward_message(chat_id, message.chat.id, message.id)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question