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 2h agoCreated Aug 27, 2026
commands/_archive.js
javascript · 742 lines
1/**#command2name: /archive3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// ==========================================================13// 💜 GIFT AI — /ARCHIVE14// SECRET ARCHIVE — OWNER + SAVED ADMINS ONLY15//16// CONNECTED SYSTEMS:17// 📖 LORE18// 🕵️ SUS19// 👻 GHOST20// 🧬 DNA21// 👁️ WATCH22//23// USAGE:24// /archive25// /archive @username26// Reply to a user's message with /archive27// ==========================================================28 29 30// ==========================================================31// CONFIG32// ==========================================================33 34var OWNER_ID = "8031061590";35var ARCHIVE_PREFIX = "GIFT_ARCHIVE_";36 37 38// ==========================================================39// ADMIN CHECK40// ==========================================================41 42var currentUserId = String(user.telegramid);43 44var admins = Bot.getProperty("GIFT_BOT_ADMINS");45 46if (!Array.isArray(admins)) {47 admins = [];48}49 50 51// ==========================================================52// CHECK SAVED ADMINS53// ==========================================================54 55var isSavedAdmin = admins.some(function(admin) {56 57 // If admin is stored directly as an ID58 if (59 typeof admin === "string" ||60 typeof admin === "number"61 ) {62 return String(admin) === currentUserId;63 }64 65 // If admin is stored as an object66 if (67 admin &&68 typeof admin === "object" &&69 admin.id !== undefined70 ) {71 return String(admin.id) === currentUserId;72 }73 74 return false;75});76 77 78// ==========================================================79// OWNER OR SAVED ADMIN ONLY80// ==========================================================81 82if (83 currentUserId !== OWNER_ID &&84 !isSavedAdmin85) {86 87 Api.sendMessage({88 89 chat_id: chat.id,90 91 text:92 "🚫 <b>ACCESS DENIED</b>\n\n" +93 "🔐 The Gift Secret Archive is classified.\n\n" +94 "👑 Only Gift's owner and saved bot admins can access it.",95 96 parse_mode: "HTML",97 98 reply_to_message_id:99 message.message_id ||100 request.message_id101 102 });103 104 return;105}106 107 108// ==========================================================109// GET TARGET110// ==========================================================111 112var target = null;113 114 115// ==========================================================116// 1. REPLIED USER117// ==========================================================118 119if (120 request.reply_to_message &&121 request.reply_to_message.from122) {123 124 target = request.reply_to_message.from;125 126}127 128 129// ==========================================================130// 2. @USERNAME131// ==========================================================132 133if (!target && params) {134 135 var input = String(params).trim();136 137 if (input.startsWith("@")) {138 139 var username = input140 .substring(1)141 .trim();142 143 if (username) {144 145 target = {146 147 id: "USERNAME_" + username.toLowerCase(),148 149 first_name: username,150 151 last_name: "",152 153 username: username154 155 };156 157 }158 159 }160 161}162 163 164// ==========================================================165// 3. DEFAULT — COMMAND SENDER166// ==========================================================167 168if (!target) {169 170 target = {171 172 id: String(user.telegramid),173 174 first_name: user.first_name || "",175 176 last_name: user.last_name || "",177 178 username: user.username || ""179 180 };181 182}183 184 185// ==========================================================186// TARGET ID187// ==========================================================188 189var targetId = String(190 target.id ||191 target.telegramid ||192 user.telegramid193);194 195 196// ==========================================================197// ARCHIVE KEY198// ==========================================================199 200var archiveKey =201 ARCHIVE_PREFIX + targetId;202 203 204// ==========================================================205// LOAD EXISTING ARCHIVE206// ==========================================================207 208var archive =209 Bot.getProperty(archiveKey);210 211 212// ==========================================================213// CREATE ARCHIVE IF MISSING214// ==========================================================215 216if (217 !archive ||218 typeof archive !== "object"219) {220 221 archive = {222 223 // ------------------------------------------------------224 // USER INFORMATION225 // ------------------------------------------------------226 227 id: targetId,228 229 first_name:230 target.first_name || "",231 232 last_name:233 target.last_name || "",234 235 username:236 target.username || "",237 238 first_seen:239 new Date().toISOString(),240 241 last_seen:242 new Date().toISOString(),243 244 messages: 0,245 246 247 // ------------------------------------------------------248 // 📖 LORE249 // ------------------------------------------------------250 251 lore: {252 253 count: 0,254 255 records: []256 257 },258 259 260 // ------------------------------------------------------261 // 🕵️ SUS262 // ------------------------------------------------------263 264 sus: {265 266 level: 0,267 268 count: 0,269 270 records: []271 272 },273 274 275 // ------------------------------------------------------276 // 👻 GHOST277 // ------------------------------------------------------278 279 ghost: {280 281 level: 0,282 283 count: 0,284 285 records: []286 287 },288 289 290 // ------------------------------------------------------291 // 🧬 DNA292 // ------------------------------------------------------293 294 dna: {295 296 type: "UNKNOWN",297 298 traits: [],299 300 count: 0,301 302 records: []303 304 },305 306 307 // ------------------------------------------------------308 // 👁️ WATCH309 // ------------------------------------------------------310 311 watch: {312 313 level: 0,314 315 count: 0,316 317 status: "NOT WATCHED",318 319 records: []320 321 }322 323 };324 325}326 327 328// ==========================================================329// REPAIR LORE330// ==========================================================331 332if (333 !archive.lore ||334 typeof archive.lore !== "object"335) {336 337 archive.lore = {338 339 count: 0,340 341 records: []342 343 };344 345}346 347if (!Array.isArray(archive.lore.records)) {348 349 archive.lore.records = [];350 351}352 353 354// ==========================================================355// REPAIR SUS356// ==========================================================357 358if (359 !archive.sus ||360 typeof archive.sus !== "object"361) {362 363 archive.sus = {364 365 level: 0,366 367 count: 0,368 369 records: []370 371 };372 373}374 375if (!Array.isArray(archive.sus.records)) {376 377 archive.sus.records = [];378 379}380 381if (382 typeof archive.sus.level !== "number"383) {384 385 archive.sus.level = 0;386 387}388 389if (390 typeof archive.sus.count !== "number"391) {392 393 archive.sus.count = 0;394 395}396 397 398// ==========================================================399// REPAIR GHOST400// ==========================================================401 402if (403 !archive.ghost ||404 typeof archive.ghost !== "object"405) {406 407 archive.ghost = {408 409 level: 0,410 411 count: 0,412 413 records: []414 415 };416 417}418 419if (!Array.isArray(archive.ghost.records)) {420 421 archive.ghost.records = [];422 423}424 425if (426 typeof archive.ghost.level !== "number"427) {428 429 archive.ghost.level = 0;430 431}432 433if (434 typeof archive.ghost.count !== "number"435) {436 437 archive.ghost.count = 0;438 439}440 441 442// ==========================================================443// REPAIR DNA444// ==========================================================445 446if (447 !archive.dna ||448 typeof archive.dna !== "object"449) {450 451 archive.dna = {452 453 type: "UNKNOWN",454 455 traits: [],456 457 count: 0,458 459 records: []460 461 };462 463}464 465if (!Array.isArray(archive.dna.traits)) {466 467 archive.dna.traits = [];468 469}470 471if (!Array.isArray(archive.dna.records)) {472 473 archive.dna.records = [];474 475}476 477if (478 typeof archive.dna.count !== "number"479) {480 481 archive.dna.count = 0;482 483}484 485if (!archive.dna.type) {486 487 archive.dna.type = "UNKNOWN";488 489}490 491 492// ==========================================================493// REPAIR WATCH494// ==========================================================495 496if (497 !archive.watch ||498 typeof archive.watch !== "object"499) {500 501 archive.watch = {502 503 level: 0,504 505 count: 0,506 507 status: "NOT WATCHED",508 509 records: []510 511 };512 513}514 515if (!Array.isArray(archive.watch.records)) {516 517 archive.watch.records = [];518 519}520 521if (522 typeof archive.watch.level !== "number"523) {524 525 archive.watch.level = 0;526 527}528 529if (530 typeof archive.watch.count !== "number"531) {532 533 archive.watch.count = 0;534 535}536 537if (!archive.watch.status) {538 539 archive.watch.status = "NOT WATCHED";540 541}542 543 544// ==========================================================545// UPDATE BASIC INFORMATION546// ==========================================================547 548if (target.first_name) {549 550 archive.first_name =551 target.first_name;552 553}554 555if (target.last_name !== undefined) {556 557 archive.last_name =558 target.last_name || "";559 560}561 562if (target.username !== undefined) {563 564 archive.username =565 target.username || "";566 567}568 569archive.last_seen =570 new Date().toISOString();571 572 573// ==========================================================574// SAVE ARCHIVE575// ==========================================================576 577Bot.setProperty(578 579 archiveKey,580 581 archive,582 583 "json"584 585);586 587 588// ==========================================================589// DISPLAY NAME590// ==========================================================591 592var fullName = [593 594 archive.first_name,595 596 archive.last_name597 598]599.filter(Boolean)600.join(" ");601 602 603if (!fullName) {604 605 fullName =606 archive.username607 ? "@" + archive.username608 : "Unknown User";609 610}611 612 613// ==========================================================614// USERNAME615// ==========================================================616 617var usernameText =618 archive.username619 ? "@" +620 String(archive.username)621 .replace(/^@/, "")622 : "No username";623 624 625// ==========================================================626// SECRET ARCHIVE627// ==========================================================628 629var text =630 631 "╔════════════════════════════╗\n" +632 633 " 💜 <b>GIFT SECRET ARCHIVE</b>\n" +634 635 "╚════════════════════════════╝\n\n" +636 637 "🔐 <b>CLASSIFICATION: SECRET</b>\n\n" +638 639 "👤 <b>SUBJECT</b>\n" +640 641 "Name: <b>" +642 fullName +643 "</b>\n" +644 645 "Username: <b>" +646 usernameText +647 "</b>\n" +648 649 "🆔 ID: <code>" +650 archive.id +651 "</code>\n\n" +652 653 654 "━━━━━━━━━━━━━━━━━━━━\n" +655 656 657 "📖 <b>LORE</b>\n" +658 659 "Entries: <b>" +660 archive.lore.count +661 "</b>\n\n" +662 663 664 "🕵️ <b>SUS</b>\n" +665 666 "Suspicion: <b>" +667 archive.sus.level +668 "%</b>\n" +669 670 "Checks: <b>" +671 archive.sus.count +672 "</b>\n\n" +673 674 675 "👻 <b>GHOST</b>\n" +676 677 "Ghost Level: <b>" +678 archive.ghost.level +679 "%</b>\n" +680 681 "Checks: <b>" +682 archive.ghost.count +683 "</b>\n\n" +684 685 686 "🧬 <b>DNA</b>\n" +687 688 "Type: <b>" +689 archive.dna.type +690 "</b>\n" +691 692 "Scans: <b>" +693 archive.dna.count +694 "</b>\n\n" +695 696 697 "👁️ <b>WATCH</b>\n" +698 699 "Level: <b>" +700 archive.watch.level +701 "%</b>\n" +702 703 "Status: <b>" +704 archive.watch.status +705 "</b>\n" +706 707 "Checks: <b>" +708 archive.watch.count +709 "</b>\n\n" +710 711 712 "━━━━━━━━━━━━━━━━━━━━\n\n" +713 714 715 "🕰️ <b>First Seen:</b>\n" +716 archive.first_seen +717 "\n\n" +718 719 "🕰️ <b>Last Seen:</b>\n" +720 archive.last_seen +721 "\n\n" +722 723 "💜 <i>Gift has opened the classified file.</i>";724 725 726// ==========================================================727// SEND ARCHIVE728// ==========================================================729 730Api.sendMessage({731 732 chat_id: chat.id,733 734 text: text,735 736 parse_mode: "HTML",737 738 reply_to_message_id:739 message.message_id ||740 request.message_id741 742});