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/_forget.js
javascript · 35 lines
1/**#command2name: /forget3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12 13 14try {15 let chatId = String(chat.id);16 let historyKey = "sarvam_history_" + chatId;17 18 await db.user.set(historyKey, []);19 await db.user.set("ai_history", []);20 await db.user.set("ai_profile", {});21 22 await Api.sendMessage({23 text: "🧹 Your personal AI conversation history and profile have been cleared."24 });25 26 return;27} catch (error) {28 console.log("FORGET ERROR:", error);29 30 await Api.sendMessage({31 text: "⚠️ Failed to clear memory: " + error.message32 });33 34 return;35}