xseaqbka/Nawaab_RoBotPublic · Bot Template

AIThis Telegram bot acts as a TOTP authenticator: users can add accounts via Base32 secret, QR code, or otpauth:// URI, list saved keys, and generate current OTP codes on demand with refresh and delete options. It includes an admin panel with user ban/unban, paginated user management, required-channel management, and a broadcast system that sends text, image, or copied replied messages to all private chats. A web dashboard endpoint provides OTP generation and account management over HTTP. The bot also supports an on/off maintenance switch and per-user access gating.

Utilitytotpauthenticatorotp2fabroadcastadmin
ProfileTelegram
59 commands1 envUpdated 10d agoCreated Aug 28, 2026
Back to folder

commands/_channel_set.js

javascript · 33 lines

Raw
1/**#command2name: /channel_set3answer: 4keyboard: 5parse_mode: html6aliases: channel_set7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/*Command: /channel_set*/13if (!(await authUtils.adminOnly())) return;14 15const parts = (params || "").split("|").map(x => x.trim());16if (parts.length < 4) {17  await authUtils.render("Usage:\n<code>/channel_set INDEX | Name | ID | URL</code>", [18    [authUtils.btn("⬅️ Channels", "channels"), authUtils.btn("✕ Close", "close", "danger")]19  ]);20  return;21}22const index = Number(parts[0]);23const channels = await db.bot.get("channels", []);24if (!Number.isInteger(index) || !channels[index]) {25  await authUtils.render("❌ Channel not found.", [[authUtils.btn("⬅️ Channels", "channels"), authUtils.btn("✕ Close", "close", "danger")]]);26  return;27}28channels[index] = { name: parts[1], id: parts[2], url: parts.slice(3).join(" | ") };29await db.bot.set("channels", channels);30await authUtils.render("✅ <b>Channel updated</b>", [31  [authUtils.btn("📢 Channels", "channels", "primary")],32  [authUtils.btn("⬅️ Admin", "admin_menu"), authUtils.btn("✕ Close", "close", "danger")]33]);