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

javascript · 44 lines

Raw
1/**#command2name: /broadcast_send3answer: 4keyboard: 5parse_mode: html6aliases: broadcast_send7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/* Command: /broadcast_send */13if (!(await authUtils.adminOnly())) return;14const d=await db.user.get("broadcast_draft",{});15if(!d.text){16  await Api.sendMessage({chat_id:chat.id,text:"❌ Broadcast text is required.",parse_mode:"HTML"});17  return;18}19const markup=d.buttons?.length?{inline_keyboard:d.buttons}:undefined;20let job;21if(d.image){22  job=await Bot.broadcast({23    method:"sendPhoto",24    body:{photo:d.image,caption:d.text,parse_mode:"HTML",reply_markup:markup},25    filters:{chatType:"private"}26  });27}else{28  job=await Bot.broadcast({29    method:"sendMessage",30    body:{text:d.text,parse_mode:"HTML",reply_markup:markup},31    filters:{chatType:"private"}32  });33}34await db.user.set("broadcast_draft",null);35await Api.sendMessage({36  chat_id:chat.id,37  text:38    "📣 <b>Broadcast Queued</b>\n\n" +39    `🆔 <code>${job.broadcastId}</code>\n` +40    `👥 Recipients: <b>${job.totalTargetChats}</b>\n` +41    `📦 Batches: <b>${job.totalBatches}</b>`,42  parse_mode:"HTML",43  reply_markup:{inline_keyboard:[[authUtils.btn("⬅️ Admin Panel","admin_menu")]]}44});