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/_bd.js
javascript · 76 lines
1/**#command2name: /bd3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/* Command: /bd */13 14if (!(await authUtils.adminOnly())) return;15 16if (!msg || !msg.reply_to_message) {17 await Api.sendMessage({18 chat_id: chat.id,19 text:20 "📣 <b>Broadcast by Reply</b>\n\n" +21 "Reply to the message you want to broadcast, then send:\n\n" +22 "<code>/bd</code>\n\n" +23 "The original message can be any Telegram-supported message type.",24 parse_mode: "HTML",25 reply_markup: {26 inline_keyboard: [27 [authUtils.btn("✕ Close", "close", "danger")]28 ]29 }30 });31 return;32}33 34const replied =35 request?.reply_to_message;36 37if (!replied) {38 await Api.sendMessage({39 chat_id: chat.id,40 text:41 "📣 <b>Broadcast by Reply</b>\n\n" +42 "Reply to any message and send <code>/bd</code>.",43 parse_mode: "HTML"44 });45 return;46}47 48await db.user.set(49 "broadcast_message_id",50 replied.message_id51);52 53await db.user.set(54 "broadcast_source_chat_id",55 replied.chat.id56);57 58const count = await authUtils.userCount();59 60await Api.sendMessage({61 chat_id: chat.id,62 text:63 "📣 <b>Confirm Broadcast</b>\n\n" +64 "The replied message will be sent to <b>" + count + "</b> users.\n\n" +65 "The original message will be copied as-is, including its media, caption and supported entities/buttons.\n\n" +66 "Do you want to continue?",67 parse_mode: "HTML",68 reply_markup: {69 inline_keyboard: [70 [71 authUtils.btn("✅ Yes, Broadcast", "bd_confirm", "success"),72 authUtils.btn("❌ No", "bd_cancel", "danger")73 ]74 ]75 }76});