adityajat/SaarvamAI_botPublic · Bot Template

ProfileTelegram

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
Back to folder

commands/_warnings.js

javascript · 62 lines

Raw
1/**#command2name: /warnings3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// ==========================================13// /warnings14// ==========================================15 16if (!isGroupChatNow()) {17  return;18}19 20 21if (!(await callerIsAdmin())) {22 23  await Api.sendMessage({24    text:25      "⛔ Only group administrators can use /warnings."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 a member's message with /warnings."41  });42 43  return;44}45 46 47let count =48  await db.bot.get(49    "warnings:" +50    String(chat.id) +51    ":" +52    String(target.id),53    054  );55 56 57await Api.sendMessage({58  text:59    "⚠️ Warnings: " +60    count +61    "/5"62});