@txsure/telegram
v0.1.0
Published
Telegram bot for TXsure payment workflow
Maintainers
Readme
@txsure/telegram
Telegram bot integration for txSure human-in-the-loop payment workflow.
Receives verification requests from txSure and sends them to Telegram with approve/cancel buttons. When a button is clicked, the decision is passed back to txSure for processing.
This is NOT a payment bot - it's a workflow notification bot for manual payment verification.
Installation
npm install @txsure/telegram txsureUsage
import { TelegramBot } from "@txsure/telegram";
const bot = TelegramBot({
token: process.env.TELEGRAM_BOT_TOKEN!,
chatId: process.env.TELEGRAM_CHAT_ID!,
});
bot.onDecision(async (decision) => {
if (decision.status === "APPROVED") {
// Update your system
}
});API
TelegramBot(config)
Creates a Telegram bot with the following config:
token: Telegram bot API tokenchatId: Chat ID to send notifications toonApprove?: Callback when payment is approved (optional)onCancel?: Callback when payment is cancelled (optional)
Returns a TXSureBot interface:
notify(transaction): Send verification request to TelegramonDecision(callback): Listen for approve/cancel actions
Setup
- Create a bot via @BotFather
- Get your bot token
- Start the bot and send a message
- Get chat ID using @userinfobot
License
MIT
