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

javascript · 207 lines

Raw
1/**#command2name: /unmute_check_admin3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// ==========================================================13// 👑 GIFT AI — /unmute_check_admin14// ADMIN CHECK + EXECUTE UNMUTE15// ==========================================================16 17var adminId = String(user.id);18 19 20// ----------------------------------------------------------21// GET SAVED DATA22// ----------------------------------------------------------23 24var chatId =25  Bot.getProperty(26    "UNMUTE_CHAT_" + adminId27  );28 29var targetId =30  Bot.getProperty(31    "UNMUTE_TARGET_" + adminId32  );33 34var targetName =35  Bot.getProperty(36    "UNMUTE_TARGET_NAME_" + adminId37  );38 39var adminName =40  Bot.getProperty(41    "UNMUTE_ADMIN_NAME_" + adminId42  );43 44var commandId =45  Bot.getProperty(46    "UNMUTE_COMMAND_" + adminId47  );48 49 50// ----------------------------------------------------------51// SAFETY CHECK52// ----------------------------------------------------------53 54if (!chatId || !targetId) {55 56  Bot.sendMessage({57    text:58      "⚠️ <b>Unmute request expired.</b>\n\n" +59      "Please try /unmute again.",60    parse_mode: "HTML"61  });62 63  return;64}65 66 67// ----------------------------------------------------------68// CHECK ADMIN69// ----------------------------------------------------------70 71var member =72  options.result || {};73 74var status =75  String(member.status || "");76 77 78if (79  status !== "administrator" &&80  status !== "creator"81) {82 83  Bot.sendMessage({84    text:85      "⛔ <b>ADMIN ONLY</b>\n\n" +86      "You don't have permission to use /unmute.",87    parse_mode: "HTML"88  });89 90  return;91}92 93 94// ----------------------------------------------------------95// RESTORE PERMISSIONS96// ----------------------------------------------------------97 98Api.restrictChatMember({99  chat_id: Number(chatId),100  user_id: Number(targetId),101 102  permissions: {103    can_send_messages: true,104    can_send_audios: true,105    can_send_documents: true,106    can_send_photos: true,107    can_send_videos: true,108    can_send_video_notes: true,109    can_send_voice_notes: true,110    can_send_polls: true,111    can_send_other_messages: true,112    can_add_web_page_previews: true113  }114});115 116 117// ----------------------------------------------------------118// HTML ESCAPER119// ----------------------------------------------------------120 121function esc(text) {122 123  return String(text || "")124    .replace(/&/g, "&amp;")125    .replace(/</g, "&lt;")126    .replace(/>/g, "&gt;")127    .replace(/"/g, "&quot;")128    .replace(/'/g, "&#039;");129}130 131 132// ----------------------------------------------------------133// TAGS134// ----------------------------------------------------------135 136var adminMention =137  '<a href="tg://user?id=' +138  String(adminId) +139  '">' +140  esc(adminName || "Admin") +141  "</a>";142 143var targetMention =144  '<a href="tg://user?id=' +145  String(targetId) +146  '">' +147  esc(targetName || "User") +148  "</a>";149 150 151// ----------------------------------------------------------152// RESPONSE153// ----------------------------------------------------------154 155var message = {156  text:157    "🔊 <b>USER UNMUTED</b>\n\n" +158    "👤 <b>User:</b> " +159    targetMention + "\n" +160    "🛡️ <b>By:</b> " +161    adminMention + "\n\n" +162    "🎉 <i>You're free to speak again.</i>",163  parse_mode: "HTML"164};165 166 167// ----------------------------------------------------------168// REPLY TO /unmute169// ----------------------------------------------------------170 171if (commandId) {172 173  message.reply_to_message_id =174    Number(commandId);175}176 177 178// ----------------------------------------------------------179// SEND180// ----------------------------------------------------------181 182Api.sendMessage(message);183 184 185// ----------------------------------------------------------186// CLEANUP187// ----------------------------------------------------------188 189Bot.deleteProperty(190  "UNMUTE_CHAT_" + adminId191);192 193Bot.deleteProperty(194  "UNMUTE_TARGET_" + adminId195);196 197Bot.deleteProperty(198  "UNMUTE_TARGET_NAME_" + adminId199);200 201Bot.deleteProperty(202  "UNMUTE_ADMIN_NAME_" + adminId203);204 205Bot.deleteProperty(206  "UNMUTE_COMMAND_" + adminId207);