We are building a Node.js Telegram bot flow that sends a message with inline Approve and Reject buttons. When you click a button, the bot processes the decision, updates the original message to reflect the choice, and removes the buttons.
This is useful for admin tasks like moderating user content, authorizing payments, or approving database writes.
Sending the message with inline buttons
To interact with the Telegram API, we will use the node-telegram-bot-api package. You will need a bot token from BotFather to authenticate your requests.
The bot sends a message containing an inline keyboard. Each button needs a callback_data string. This is the payload Telegram sends back to your server when the user clicks the button.
import TelegramBot from ' node-telegram-bot-api ' ;
const token = process . env .…