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/_admin_users.js
javascript · 64 lines
1/**#command2name: /admin_users3answer: 4keyboard: 5parse_mode: html6aliases: admin_users7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/* Command: /admin_users */13if (!(await authUtils.adminOnly())) return;14 15const requestedPage = Number(options?.page ?? params ?? 0);16const pageNumber = Number.isInteger(requestedPage) && requestedPage >= 0 ? requestedPage : 0;17 18const allUserIds = await Bot.getUsers({ chatType: "private" });19const pageSize = 8;20const pageStart = pageNumber * pageSize;21const pageUsers = allUserIds.slice(pageStart, pageStart + pageSize);22 23const rows = [];24 25for (const targetUserId of pageUsers) {26 const targetBanned = await db.user.get("banned", false, {27 user_id: targetUserId28 });29 30 rows.push([31 authUtils.btn(32 (targetBanned ? "🚫 " : "👤 ") + String(targetUserId),33 "user_" + targetUserId34 )35 ]);36}37 38if (!pageUsers.length) {39 rows.push([authUtils.btn("No users on this page", "admin_users", "primary")]);40}41 42const navigation = [];43 44if (pageNumber > 0) {45 navigation.push(authUtils.btn("◀️ Prev", "admin_users_" + (pageNumber - 1)));46}47 48if (pageStart + pageSize < allUserIds.length) {49 navigation.push(authUtils.btn("Next ▶️", "admin_users_" + (pageNumber + 1)));50}51 52if (navigation.length) rows.push(navigation);53 54rows.push([55 authUtils.btn("⬅️ Admin Panel", "admin_menu"),56 authUtils.btn("✕ Close", "close", "danger")57]);58 59await authUtils.render(60 "👥 <b>User Management</b>\n\n" +61 `Total users: <b>${allUserIds.length}</b>\n` +62 `Page: <b>${pageNumber + 1}</b>`,63 rows64);