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/_automod.js

javascript · 93 lines

Raw
1/**#command2name: /automod3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// ==========================================13// /automod14// ==========================================15 16if (!isGroupChatNow()) {17  return;18}19 20 21if (!(await callerIsAdmin())) {22 23  await Api.sendMessage({24    text:25      "⛔ Only administrators can use /automod."26  });27 28  return;29}30 31 32let mode =33  String(params || "")34    .trim()35    .toLowerCase();36 37 38let key =39  "automod:" +40  String(chat.id);41 42 43if (44  mode === "on"45) {46 47  await db.bot.set(48    key,49    true50  );51 52  await Api.sendMessage({53    text:54      "🛡️ Automatic moderation is now ON.\n\n" +55      "The bot will conservatively detect clearly abusive behaviour directed toward administrators."56  });57 58  return;59}60 61 62if (63  mode === "off"64) {65 66  await db.bot.set(67    key,68    false69  );70 71  await Api.sendMessage({72    text:73      "🛡️ Automatic moderation is now OFF."74  });75 76  return;77}78 79 80let status =81  await db.bot.get(82    key,83    true84  );85 86 87await Api.sendMessage({88  text:89    "🛡️ Auto-moderation: " +90    (status ? "ON" : "OFF") +91    "\n\n" +92    "Use /automod on or /automod off."93});