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_add.js

javascript · 40 lines

Raw
1/**#command2name: /channel_add3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/*Command: channel_add*/13if (!(await authUtils.adminOnly())) return;14 15if (!params) {16  await authUtils.render(17    "➕ <b>Add required channel</b>\n\n" +18    "Use:\n<code>/channel_add Name | @username-or-chat-id | https://t.me/...</code>\n\n" +19    "For a private channel, use its numeric chat ID in the middle field and its invite link in the URL field.",20    [[authUtils.btn("✕ Cancel", "channels", "danger")]]21  );22  return;23}24 25const parts = params.split("|").map(x => x.trim());26if (parts.length < 3 || !parts[0] || !parts[1] || !parts[2]) {27  await authUtils.render("❌ Format error.\n\n<code>/channel_add Name | @username-or-chat-id | join-url</code>", [28    [authUtils.btn("✕ Cancel", "channels", "danger")]29  ]);30  return;31}32 33const channels = await db.bot.get("channels", []);34channels.push({ name: parts[0], id: parts[1], url: parts.slice(2).join(" | ") });35await db.bot.set("channels", channels);36 37await authUtils.render("✅ <b>Channel added</b>\n\n" + parts[0] + "\n<code>" + parts[1] + "</code>", [38  [authUtils.btn("📢 Manage Channels", "channels", "primary")],39  [authUtils.btn("⬅️ Admin", "admin_menu"), authUtils.btn("✕ Close", "close", "danger")]40]);