adityajat/SaarvamAI_botPublic · Bot Template
AISarvam AI is a multi‑purpose Telegram bot that lets users ask questions, get explanations, convert text to speech, and translate messages using the Sarvam AI API. It also offers group administration commands such as warn, mute, ban, pin, delete, and announcements, and can clear personal or group AI memory. The bot uses the TeleBotHost TBL framework with Bot, Api, db, and HTTP calls, and provides inline keyboards for language and voice selection.
Ai Assistantaivoicetranslatemoderationadminsarvam
34 commands4 envUpdated 15d agoCreated Sep 14, 2026
commands/_handle_pre_checkout_query.js
javascript · 28 lines
1/**#command2name: /handle_pre_checkout_query3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12 13const q = update && update.pre_checkout_query;14 15if (!q) return;16 17const valid =18 q.invoice_payload === "sarvam_voice_credits_10_v1" &&19 q.currency === "XTR" &&20 q.total_amount === 50;21 22await Api.answerPreCheckoutQuery({23 pre_checkout_query_id: q.id,24 ok: valid,25 error_message: valid26 ? undefined27 : "Invalid voice credit package. Please create a new invoice."28});