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_buttons.js

javascript · 31 lines

Raw
1/**#command2name: /broadcast_buttons3answer: 4keyboard: 5parse_mode: html6aliases: broadcast_buttons7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/* Command: /broadcast_buttons */13if (!await authUtils.isAdmin()) return;14const d = await db.user.get("broadcast_draft", {}, { user_id: user.id });15const parts = String(message || "").split(",").map(x => x.trim()).filter(Boolean);16const buttons = [];17for (const part of parts) {18  const i = part.indexOf(":");19  if (i <= 0) continue;20  const text = part.slice(0, i).trim();21  const url = part.slice(i + 1).trim();22  if (text && /^https?:\/\/\S+$/i.test(url)) buttons.push({ text, url });23}24if (!buttons.length) {25  await Api.sendMessage({ chat_id: chat.id, text: "❌ No valid buttons found. Use <code>Name: https://example.com</code>.", parse_mode: "HTML" });26  return;27}28d.buttons = [];29for (let i = 0; i < buttons.length; i += 2) d.buttons.push(buttons.slice(i, i + 2));30await db.user.set("broadcast_draft", d, { user_id: user.id });31await Bot.runCommand("/broadcast_send");