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

javascript · 27 lines

Raw
1/**#command2name: ban_03answer: 4keyboard: 5parse_mode: html6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/*Command: ban_0*/13if (!(await authUtils.adminOnly())) return;14 15const data = update.callback_query?.data || "";16let m = data.match(/^(ban|unban)_(\d+)$/);17if (!m) return;18const action = m[1], target = Number(m[2]);19await db.user.set("banned", action === "ban", { user_id: target });20 21if (action === "ban") {22  await Api.sendMessage({ chat_id: target, text: "🚫 <b>Your access has been suspended.</b>", parse_mode: "HTML" }).catch(() => {});23}24await authUtils.render(25  (action === "ban" ? "🚫" : "🟢") + " <b>User " + (action === "ban" ? "banned" : "unbanned") + "</b>\n\nID: <code>" + target + "</code>",26  [[authUtils.btn("👤 User", "user_" + target)], [authUtils.btn("⬅️ Users", "admin_users"), authUtils.btn("✕ Close", "close", "danger")]]27);