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/_unmute.js
javascript · 110 lines
1/**#command2name: /unmute3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// ==========================================13// /unmute14// ==========================================15 16if (!isGroupChatNow()) {17 return;18}19 20 21if (!(await callerIsAdmin())) {22 23 await Api.sendMessage({24 text:25 "⛔ Only administrators can use /unmute."26 });27 28 return;29}30 31 32let target =33 getTargetAndRest();34 35 36if (!target) {37 38 await Api.sendMessage({39 text:40 "Reply to the muted member with /unmute."41 });42 43 return;44}45 46 47let chatInfo =48 await Api.call(49 "getChat",50 {51 chat_id: chat.id52 }53 );54 55 56let permissions = {57 can_send_messages: true,58 can_send_audios: true,59 can_send_documents: true,60 can_send_photos: true,61 can_send_videos: true,62 can_send_video_notes: true,63 can_send_voice_notes: true,64 can_send_polls: true,65 can_send_other_messages: true,66 can_add_web_page_previews: true,67 can_invite_users: true,68 can_pin_messages: false,69 can_manage_topics: false70};71 72 73if (74 chatInfo &&75 chatInfo.ok &&76 chatInfo.result &&77 chatInfo.result.permissions78) {79 permissions =80 chatInfo.result.permissions;81}82 83 84let r =85 await Api.call(86 "restrictChatMember",87 {88 chat_id: chat.id,89 user_id: target.id,90 permissions: permissions,91 use_independent_chat_permissions: true92 }93 );94 95 96if (!r || !r.ok) {97 98 await Api.sendMessage({99 text:100 "❌ Telegram could not remove the restriction."101 });102 103 return;104}105 106 107await Api.sendMessage({108 text:109 "🔊 Member unmuted."110});