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
112 commands3 envUpdated 1h agoCreated Aug 27, 2026
commands/_del.js
javascript · 164 lines
1/**#command2name: /del3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// ==========================================================13// 🗑️ GIFT — /del14// FAST • RESPONSIVE • ADMIN ONLY15//16// Usage:17// • Reply to a user's message with /del18// • Gift deletes the target message19// • Gift deletes the /del command too20// ==========================================================21 22 23// ----------------------------------------------------------24// REQUIRE REPLY25// ----------------------------------------------------------26 27if (28 !request ||29 !request.reply_to_message ||30 !request.reply_to_message.message_id31) {32 33 await Api.sendMessage({34 chat_id: chat.id,35 text: "🗑️ <b>Reply to the message you want me to delete.</b>",36 parse_mode: "HTML",37 reply_to_message_id: request ? request.message_id : undefined38 });39 40 return;41}42 43 44// ----------------------------------------------------------45// GET IDs46// ----------------------------------------------------------47 48var chatId = chat.id;49var adminId = request.from.id;50 51var targetMessageId =52 request.reply_to_message.message_id;53 54 55// ----------------------------------------------------------56// CHECK ADMIN57// ----------------------------------------------------------58 59var adminCheck = await Api.getChatMember({60 chat_id: chatId,61 user_id: adminId62});63 64if (65 !adminCheck ||66 !adminCheck.ok ||67 !adminCheck.result68) {69 70 await Api.sendMessage({71 chat_id: chatId,72 text: "⚠️ <b>I couldn't verify your admin status.</b>",73 parse_mode: "HTML",74 reply_to_message_id: request.message_id75 });76 77 return;78}79 80 81var status =82 adminCheck.result.status;83 84 85// Only admins and creator86if (87 status !== "administrator" &&88 status !== "creator"89) {90 91 await Api.sendMessage({92 chat_id: chatId,93 text: "🚫 <b>Only group admins can use /del.</b>",94 parse_mode: "HTML",95 reply_to_message_id: request.message_id96 });97 98 return;99}100 101 102// ----------------------------------------------------------103// DELETE TARGET MESSAGE104// ----------------------------------------------------------105 106var deleteResult;107 108try {109 110 deleteResult = await Api.deleteMessage({111 chat_id: chatId,112 message_id: targetMessageId113 });114 115} catch (e) {116 117 deleteResult = null;118}119 120 121// ----------------------------------------------------------122// DELETE /del COMMAND123// ----------------------------------------------------------124 125try {126 127 await Api.deleteMessage({128 chat_id: chatId,129 message_id: request.message_id130 });131 132} catch (e) {133 // Ignore if Telegram doesn't allow deleting it134}135 136 137// ----------------------------------------------------------138// FAILURE MESSAGE139// ----------------------------------------------------------140 141if (142 !deleteResult ||143 !deleteResult.ok144) {145 146 await Api.sendMessage({147 chat_id: chatId,148 text:149 "❌ <b>I couldn't delete that message.</b>\n\n" +150 "Make sure Gift is an admin with permission to delete messages.",151 parse_mode: "HTML"152 });153 154 return;155}156 157 158// ----------------------------------------------------------159// SUCCESS160// ----------------------------------------------------------161 162// No message is sent.163// The target message and /del command are simply removed.164return;