millswelbeck148/SireimadeBotPublic · Bot Template

AISireImade appears to be a Telegram automation bot. Commands include /start, /about, /support, /id, /admin, /ban, /unban, /x. Observed in code: messaging, keyboards, games.

Utilityutility
ProfileTelegram
112 commands3 envUpdated 2h agoCreated Aug 27, 2026
Back to folder

commands/_play.js

javascript · 313 lines

Raw
1/**#command2name: /play3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// ==========================================================13// 🎵 GIFT AI — /play14// ⚡ FAST • SIMPLE • RESPONSIVE15// 🎧 PREXZy YOUTUBE MP316// 💬 DIRECT REPLY17// ==========================================================18 19 20// ----------------------------------------------------------21// INPUT22// ----------------------------------------------------------23 24var url = String(params || "").trim();25 26 27// ----------------------------------------------------------28// USER NAME29// ----------------------------------------------------------30 31var userName = "there";32 33try {34  userName =35    user.first_name ||36    request.from.first_name ||37    "there";38} catch (e) {}39 40 41// ----------------------------------------------------------42// MESSAGE ID43// ----------------------------------------------------------44 45var messageId = null;46 47try {48  messageId = request.message_id;49} catch (e) {}50 51 52// ----------------------------------------------------------53// NO URL54// ----------------------------------------------------------55 56if (!url) {57 58  Bot.sendMessage({59    text:60      "🎵 <b>GIFT PLAY</b>\n\n" +61      "Hey " + userName + " 👋\n\n" +62      "Send me a YouTube link and I'll get the audio for you.\n\n" +63      "💡 <b>Example:</b>\n" +64      "<code>/play https://www.youtube.com/watch?v=dQw4w9WgXcQ</code>",65    parse_mode: "HTML",66    reply_to_message_id: messageId67  });68 69  return;70}71 72 73// ----------------------------------------------------------74// CHECK YOUTUBE LINK75// ----------------------------------------------------------76 77if (78  !/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.be)\//i.test(url)79) {80 81  Bot.sendMessage({82    text:83      "⚠️ <b>Invalid YouTube link</b>\n\n" +84      "Please send a valid YouTube URL.",85    parse_mode: "HTML",86    reply_to_message_id: messageId87  });88 89  return;90}91 92 93// ----------------------------------------------------------94// GIFT PROCESSING95// ----------------------------------------------------------96 97Bot.sendMessage({98  text:99    "🎵 <b>GIFT PLAY</b>\n\n" +100    "🔎 Getting your audio...\n" +101    "⏳ Please wait, " + userName + " ✨",102  parse_mode: "HTML",103  reply_to_message_id: messageId104});105 106 107// ----------------------------------------------------------108// PREXZy API109// ----------------------------------------------------------110 111var apiUrl =112  "https://prexzyapis.com/download/ytmp3?url=" +113  encodeURIComponent(url);114 115 116// ----------------------------------------------------------117// REQUEST118// ----------------------------------------------------------119 120try {121 122  var response = await HTTP.get(apiUrl, {123    timeout: 20000,124    responseType: "json"125  });126 127 128  // --------------------------------------------------------129  // CHECK RESPONSE130  // --------------------------------------------------------131 132  if (!response || !response.ok) {133 134    Bot.sendMessage({135      text:136        "❌ <b>GIFT PLAY</b>\n\n" +137        "Prexzy couldn't process this YouTube video.\n\n" +138        "🔄 Try another YouTube link.",139      parse_mode: "HTML",140      reply_to_message_id: messageId141    });142 143    return;144  }145 146 147  var data = response.data;148 149 150  // --------------------------------------------------------151  // FIND AUDIO URL152  // --------------------------------------------------------153 154  var audioUrl = "";155 156 157  if (typeof data === "string") {158 159    audioUrl = data;160 161  } else if (data && typeof data === "object") {162 163    audioUrl =164      data.url ||165      data.audio ||166      data.audio_url ||167      data.audioUrl ||168      data.download ||169      data.download_url ||170      data.downloadUrl ||171      "";172  }173 174 175  // --------------------------------------------------------176  // NESTED DATA177  // --------------------------------------------------------178 179  if (180    !audioUrl &&181    data &&182    data.data &&183    typeof data.data === "object"184  ) {185 186    audioUrl =187      data.data.url ||188      data.data.audio ||189      data.data.audio_url ||190      data.data.audioUrl ||191      data.data.download ||192      data.data.download_url ||193      data.data.downloadUrl ||194      "";195  }196 197 198  // --------------------------------------------------------199  // NO AUDIO200  // --------------------------------------------------------201 202  if (203    !audioUrl ||204    typeof audioUrl !== "string"205  ) {206 207    console.log(208      "GIFT PLAY PREXZy RESPONSE:",209      JSON.stringify(data)210    );211 212    Bot.sendMessage({213      text:214        "❌ <b>GIFT PLAY</b>\n\n" +215        "Prexzy responded, but no audio link was found.\n\n" +216        "Please try another video.",217      parse_mode: "HTML",218      reply_to_message_id: messageId219    });220 221    return;222  }223 224 225  // --------------------------------------------------------226  // TITLE227  // --------------------------------------------------------228 229  var title = "Gift Music";230 231  try {232 233    title =234      data.title ||235      data.name ||236      data.filename ||237      "Gift Music";238 239    if (240      data.data &&241      typeof data.data === "object"242    ) {243 244      title =245        data.data.title ||246        data.data.name ||247        data.data.filename ||248        title;249    }250 251  } catch (e) {}252 253 254// ----------------------------------------------------------255// SEND AUDIO256// ----------------------------------------------------------257 258  try {259 260    await Api.sendAudio({261      chat_id: chat.id,262      audio: audioUrl,263      title: String(title).substring(0, 64),264      caption:265        "🎵 <b>" +266        String(title)267          .replace(/&/g, "&amp;")268          .replace(/</g, "&lt;")269          .replace(/>/g, "&gt;") +270        "</b>\n\n" +271        "⚡ <b>Gift AI</b>",272      parse_mode: "HTML",273      reply_to_message_id: messageId274    });275 276  } catch (audioError) {277 278    console.log(279      "GIFT PLAY AUDIO ERROR:",280      audioError281    );282 283    Bot.sendMessage({284      text:285        "🎵 <b>Audio ready!</b>\n\n" +286        "Telegram couldn't send the audio file directly.\n\n" +287        "🔗 <a href=\"" +288        audioUrl +289        "\">Open Audio</a>",290      parse_mode: "HTML",291      reply_to_message_id: messageId292    });293 294  }295 296 297} catch (error) {298 299  console.log(300    "GIFT PLAY ERROR:",301    error302  );303 304  Bot.sendMessage({305    text:306      "❌ <b>GIFT PLAY</b>\n\n" +307      "I couldn't process that YouTube link right now.\n\n" +308      "🔄 Please try again.",309    parse_mode: "HTML",310    reply_to_message_id: messageId311  });312 313      }