I added bot to channel as administrator but I have no messages in bot.on('message'
callback. I have no problems with groups add bot privacy disabled. How to get upcoming channel messages?
const TelegramBot = require('node-telegram-bot-api');
let bot = new TelegramBot('xxxxxxxxxxxxxxxxxx', {polling: true});
bot.on('message', (msg) => {
console.log(`${msg.from.username}: ${msg.text} ${msg.location}`);
});
as you can see in the documentation the right attribute of update is "channel_post" and not "message"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With