I’m writing a bot that will monitor the Telegram channel and perform certain manipulations in case of a new publication there. The bot is connected to the channel and has administrator rights. In the BotFather settings, message permissions are also enabled. I tried to implement this through the channel_post_handler, but the bot does not react to new messages in the channel, although it can leave them. There are no errors in the console.
import telebot
BOT_TOKEN = 'TOKEN'
bot = telebot.TeleBot(BOT_TOKEN)
@bot.channel_post_handler(content_types=['text'])
def handle_channel_message(message):
print('good!')
bot.polling()
what’s the problem? Or point a newbie in the right direction. Thank.
Pol York is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.