Closed ngugcx closed 3 months ago
Bug Report
I have read:
I am using the latest version of the library, 0.65.1.
Below is my code, I expect bot.on('message', ...) is triggered whenever there is a message.
import TelegramBot from 'node-telegram-bot-api' async function main () { const token = '__telegram_bot_token__' const bot = new TelegramBot(token, { polling: true }) bot.onText(/\/echo (.+)/, (msg, match) => { const chatId = msg.chat.id console.log(chatId) const resp = match[1] bot.sendMessage(chatId, resp) }) bot.on('message', (msg) => { const chatId = msg.chat.id.toString() console.log(chatId) bot.sendMessage(chatId, 'New channel enabled') }) } try { main() } catch (err) { console.error(err) }
bot.on('message', ...) is only triggered when bot.onText is triggered.
I have read:
I am using the latest version of the library, 0.65.1.
Expected Behavior
Below is my code, I expect bot.on('message', ...) is triggered whenever there is a message.
Actual Behavior
bot.on('message', ...) is only triggered when bot.onText is triggered.