inmsuvo/pcvdbotPublic · Bot Template

ProfileTelegram

Advanced AI Group Security & Moderation Bot with Anti-Link, Anti-NSFW, Anti-Spam & Auto-Warn features.

Moderationmoderationantilinkantiforwardantisnsantispamwelcome
12 commands0 envUpdated 25d agoCreated Oct 2, 2026
Back to folder

commands/_settings.js

javascript · 61 lines

Raw
1/**#command2name: /settings3answer: 4keyboard: 5parse_mode: html6aliases: 7allow_only_group: true8need_reply: false9is_web: 010#command**/11 12let chat_id = chat.id;13let userId = request.from.id;14 15// Admin check16let isAdmin = false;17try {18  let member = await Api.getChatMember({ chat_id: chat_id, user_id: userId });19  let status = member && (member.status || (member.result && member.result.status));20  if (status === "creator" || status === "administrator") { isAdmin = true; }21} catch(e) {}22 23if (!isAdmin) {24  return Api.sendMessage({25    chat_id: chat_id,26    receiver_user_id: userId,27    text: "⚠️ Only admins can use group settings!",28    parse_mode: "HTML"29  });30}31 32let linkVal = Bot.getProperty("antilink_" + chat_id, "off");33let linkStatus = (linkVal && linkVal.toString().toUpperCase() === "ON") ? "🟢 ON" : "🔴 OFF";34 35let fwdVal = Bot.getProperty("antiforward_" + chat_id, "off");36let fwdStatus = (fwdVal && fwdVal.toString().toUpperCase() === "ON") ? "🟢 ON" : "🔴 OFF";37 38let nsfwVal = Bot.getProperty("antisns_" + chat_id, "off");39let nsfwStatus = (nsfwVal && nsfwVal.toString().toUpperCase() === "ON") ? "🟢 ON" : "🔴 OFF";40 41let welcomeVal = Bot.getProperty("welcome_" + chat_id, "on");42let welcomeStatus = (welcomeVal && welcomeVal.toString().toUpperCase() === "ON") ? "🟢 ON" : "🔴 OFF";43 44let raidVal = Bot.getProperty("antiraid_" + chat_id, "off");45let raidStatus = (raidVal && raidVal.toString().toUpperCase() === "ON") ? "🟢 ON" : "🔴 OFF";46 47let ik = [48  [{ text: "🔗 Anti-Link: " + linkStatus, callback_data: "settings_panel toggle_antilink" }],49  [{ text: "↗️ Anti-Forward: " + fwdStatus, callback_data: "settings_panel toggle_antiforward" }],50  [{ text: "🔞 Anti-NSFW: " + nsfwStatus, callback_data: "settings_panel toggle_antisns" }],51  [{ text: "👋 Welcome Msg: " + welcomeStatus, callback_data: "settings_panel toggle_welcome" }],52  [{ text: "🛡️ Anti-Raid Mode: " + raidStatus, callback_data: "settings_panel toggle_antiraid" }],53  [{ text: "🔄 Refresh Panel", callback_data: "settings_panel refresh" }]54];55 56Api.sendMessage({57  chat_id: chat_id,58  text: "⚙️ <b>Advanced Group Security & Management Panel</b>\n\nManage modules below:",59  parse_mode: "HTML",60  reply_markup: { inline_keyboard: ik }61});