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
59 commands1 envUpdated 10d agoCreated Aug 28, 2026
commands/_.js
javascript · 44 lines
1/**#command2name: *3answer: 4keyboard: 5parse_mode: html6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12if (!message) return;13const input = String(message).trim();14if (!input || input.startsWith("/")) return;15 16if (!(await authUtils.userGuard())) return;17if (!(await authUtils.userGate())) return;18 19// If a valid key was submitted previously, the next plain text is its name.20const pending = await authUtils.getPendingAccount();21if (pending) {22 const result = await authUtils.finalizePendingAccount(input);23 if (!result.ok) return;24 25 await Api.sendMessage({26 chat_id: chat.id,27 text: "✅ <b>Key Saved</b>\n\nYour OTP is ready. Send /start to view your keys.",28 parse_mode: "HTML"29 });30 return;31}32 33// Otherwise only accept a valid secret key.34const parsed = authUtils.parseOtpAuth(input);35if (!parsed) return;36 37await authUtils.clearMenu();38await authUtils.savePendingAccount(parsed, "secret");39 40await Api.sendMessage({41 chat_id: chat.id,42 text: "🏷️ <b>Name Your Account</b>\n\nSend a name for this key.",43 parse_mode: "HTML"44});