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/_start.js

javascript · 72 lines

Raw
1/**#command2name: /start3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12if (!(await authUtils.userGuard())) return;13if (!(await authUtils.userGate())) return;14 15// Remove the previous chat menu/message before creating a new one16await authUtils.clearMenu();17 18const keys = await authUtils.getKeys();19const rows = [];20 21if (keys.length > 0) {22  for (let i = 0; i < keys.length; i += 2) {23    const row = [24      authUtils.btn(25        "🔐 " + (keys[i].name || "Account " + (i + 1)),26        "view_" + (i + 1)27      )28    ];29 30    if (keys[i + 1]) {31      row.push(32        authUtils.btn(33          "🔐 " + (keys[i + 1].name || "Account " + (i + 2)),34          "view_" + (i + 2)35        )36      );37    }38 39    rows.push(row);40  }41}42 43// Admin button44if (await authUtils.isAdmin()) {45  rows.push([46    authUtils.btn("🛡️ Admin Panel", "admin_menu", "primary")47  ]);48}49 50let text;51 52// No keys yet53if (keys.length === 0) {54  text =55    "👋 <b>Welcome to AuthKey</b>\n\n" +56    "Generate authentication codes instantly.\n\n" +57    "Send your 2FA secret key anywhere in this chat and I'll generate your current 6-digit authentication code.\n\n" +58    "<b>Example:</b>\n" +59    "<code>JBSWY3DPEHPK3PXP</code>";60}61 62// Keys exist63else {64  text =65    "👋 <b>Welcome to AuthKey</b>\n\n" +66    "Generate authentication codes instantly.\n\n" +67    "Send your 2FA secret key anywhere in this chat and I'll generate your current 6-digit authentication code.\n\n" +68    "🔐 <b>Your saved keys</b>\n" +69    "Select a key below to view its OTP.";70}71 72await authUtils.render(text, rows);