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/_unban.js
javascript · 72 lines
1/**#command2name: /unban3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// ==========================================13// /unban14// ==========================================15 16if (!isGroupChatNow()) {17 return;18}19 20 21if (!(await callerIsAdmin())) {22 23 await Api.sendMessage({24 text:25 "⛔ Only administrators can use /unban."26 });27 28 return;29}30 31 32let target =33 getTargetAndRest();34 35 36if (!target) {37 38 await Api.sendMessage({39 text:40 "Use:\n/unban USER_ID"41 });42 43 return;44}45 46 47let r =48 await Api.call(49 "unbanChatMember",50 {51 chat_id: chat.id,52 user_id: target.id,53 only_if_banned: true54 }55 );56 57 58if (!r || !r.ok) {59 60 await Api.sendMessage({61 text:62 "❌ Telegram could not unban this user."63 });64 65 return;66}67 68 69await Api.sendMessage({70 text:71 "✅ Member unbanned."72});