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/_lore.js
javascript · 429 lines
1/**#command2name: /lore3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// ==========================================================13// 📜 GIFT AI — /LORE14//15// • /lore16// • /lore add <event>17// • /lore clear18// • Permanent group lore19// • Group-specific database20// • Direct reply to command21// ==========================================================22 23 24// ==========================================================25// CONFIG26// ==========================================================27 28var OWNER_ID = "8031061590";29 30 31// ==========================================================32// CHECK GROUP33// ==========================================================34 35if (36 chat.type !== "group" &&37 chat.type !== "supergroup"38) {39 40 Api.sendMessage({41 42 chat_id: chat.id,43 44 text:45 "📜 <b>LORE</b>\n\n" +46 "This command only works inside groups.",47 48 parse_mode: "HTML",49 50 reply_to_message_id:51 request.message_id52 53 });54 55 return;56}57 58 59// ==========================================================60// GROUP KEY61// ==========================================================62 63var groupId =64 String(chat.id);65 66var loreKey =67 "GIFT_LORE_" + groupId;68 69 70// ==========================================================71// GET LORE72// ==========================================================73 74var lore =75 Bot.getProperty(loreKey);76 77if (!Array.isArray(lore)) {78 lore = [];79}80 81 82// ==========================================================83// PARAMETERS84// ==========================================================85 86var input =87 (params || "").trim();88 89 90// ==========================================================91// ADD LORE92// ==========================================================93 94if (95 input.toLowerCase().indexOf("add ") === 096) {97 98 // --------------------------------------------------------99 // ADMIN CHECK100 // --------------------------------------------------------101 102 var isAdmin = false;103 104 try {105 106 var member =107 await Api.call(108 "getChatMember",109 {110 chat_id: chat.id,111 user_id: user.telegramid112 }113 );114 115 if (116 member &&117 member.result &&118 (119 member.result.status === "administrator" ||120 member.result.status === "creator"121 )122 ) {123 124 isAdmin = true;125 126 }127 128 } catch (e) {129 130 // Owner always passes131 if (132 String(user.telegramid) === OWNER_ID133 ) {134 135 isAdmin = true;136 137 }138 139 }140 141 142 if (143 String(user.telegramid) === OWNER_ID144 ) {145 146 isAdmin = true;147 148 }149 150 151 if (!isAdmin) {152 153 Api.sendMessage({154 155 chat_id: chat.id,156 157 text:158 "❌ Only group admins can add lore.",159 160 reply_to_message_id:161 request.message_id162 163 });164 165 return;166 167 }168 169 170 // --------------------------------------------------------171 // REMOVE "ADD "172 // --------------------------------------------------------173 174 var eventText =175 input.substring(4).trim();176 177 178 if (!eventText) {179 180 Api.sendMessage({181 182 chat_id: chat.id,183 184 text:185 "📜 <b>LORE ADD</b>\n\n" +186 "Use:\n" +187 "<code>/lore add something happened</code>",188 189 parse_mode: "HTML",190 191 reply_to_message_id:192 request.message_id193 194 });195 196 return;197 198 }199 200 201 // --------------------------------------------------------202 // CREATE EVENT203 // --------------------------------------------------------204 205 lore.push({206 207 id:208 String(new Date().getTime()),209 210 text:211 eventText,212 213 added_by:214 String(user.telegramid),215 216 added_name:217 user.first_name ||218 user.username ||219 "Unknown",220 221 date:222 new Date().toISOString()223 224 });225 226 227 // --------------------------------------------------------228 // LIMIT DATABASE229 // --------------------------------------------------------230 231 if (lore.length > 100) {232 233 lore =234 lore.slice(235 lore.length - 100236 );237 238 }239 240 241 // --------------------------------------------------------242 // SAVE243 // --------------------------------------------------------244 245 Bot.setProperty(246 loreKey,247 lore,248 "json"249 );250 251 252 Api.sendMessage({253 254 chat_id: chat.id,255 256 text:257 "📜 <b>LORE RECORDED</b>\n\n" +258 "📝 " +259 eventText +260 "\n\n" +261 "💜 <i>The database remembers.</i>",262 263 parse_mode: "HTML",264 265 reply_to_message_id:266 request.message_id267 268 });269 270 return;271 272}273 274 275// ==========================================================276// CLEAR LORE277// ==========================================================278 279if (280 input.toLowerCase() === "clear"281) {282 283 if (284 String(user.telegramid) !== OWNER_ID285 ) {286 287 Api.sendMessage({288 289 chat_id: chat.id,290 291 text:292 "❌ Only Gift's owner can clear the lore.",293 294 reply_to_message_id:295 request.message_id296 297 });298 299 return;300 301 }302 303 304 Bot.setProperty(305 loreKey,306 [],307 "json"308 );309 310 311 Api.sendMessage({312 313 chat_id: chat.id,314 315 text:316 "🗑️ <b>GROUP LORE CLEARED.</b>\n\n" +317 "Gift has erased the evidence. 👀",318 319 parse_mode: "HTML",320 321 reply_to_message_id:322 request.message_id323 324 });325 326 return;327 328}329 330 331// ==========================================================332// NO LORE333// ==========================================================334 335if (lore.length === 0) {336 337 Api.sendMessage({338 339 chat_id: chat.id,340 341 text:342 "📜 <b>GROUP LORE</b>\n\n" +343 "Nothing has been recorded yet.\n\n" +344 "Admins can add the first piece of history with:\n" +345 "<code>/lore add something happened</code>",346 347 parse_mode: "HTML",348 349 reply_to_message_id:350 request.message_id351 352 });353 354 return;355 356}357 358 359// ==========================================================360// SHOW LORE361// ==========================================================362 363var recent =364 lore.slice(365 Math.max(366 0,367 lore.length - 10368 )369 );370 371 372var text =373 "📜 <b>GIFT'S GROUP LORE</b>\n\n";374 375 376for (377 var i = recent.length - 1;378 i >= 0;379 i--380) {381 382 var item =383 recent[i];384 385 var date =386 new Date(387 item.date388 ).toLocaleDateString();389 390 text +=391 "🕯️ <b>" +392 item.text +393 "</b>\n" +394 395 "👤 " +396 item.added_name +397 "\n" +398 399 "📅 " +400 date +401 "\n\n";402 403}404 405 406text +=407 "📚 Total recorded events: <b>" +408 lore.length +409 "</b>\n\n" +410 411 "💜 <i>The group forgets. Gift doesn't.</i>";412 413 414// ==========================================================415// SEND DIRECT REPLY416// ==========================================================417 418Api.sendMessage({419 420 chat_id: chat.id,421 422 text: text,423 424 parse_mode: "HTML",425 426 reply_to_message_id:427 request.message_id428 429});