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

javascript · 141 lines

Raw
1/**#command2name: /ping3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// ==========================================================13// GIFT AI — /ping14// PUBLIC COMMAND — FAST + ACCURATE + RELIABLE15// ==========================================================16 17// ----------------------------------------------------------18// START TIMER19// ----------------------------------------------------------20 21var pingStart = Date.now();22 23// ----------------------------------------------------------24// GET / INITIALIZE BOT START TIME25// ----------------------------------------------------------26 27var startedAt = Bot.getProperty("bot_started_at");28 29if (30  !startedAt ||31  isNaN(Number(startedAt)) ||32  Number(startedAt) <= 033) {34 35  startedAt = pingStart;36 37  Bot.setProperty(38    "bot_started_at",39    startedAt,40    "integer"41  );42}43 44// ----------------------------------------------------------45// CALCULATE UPTIME SAFELY46// ----------------------------------------------------------47 48var uptimeMs = Math.max(49  0,50  pingStart - Number(startedAt)51);52 53var totalSeconds = Math.floor(54  uptimeMs / 100055);56 57var days = Math.floor(58  totalSeconds / 8640059);60 61totalSeconds %= 86400;62 63var hours = Math.floor(64  totalSeconds / 360065);66 67totalSeconds %= 3600;68 69var minutes = Math.floor(70  totalSeconds / 6071);72 73var seconds = totalSeconds % 60;74 75// ----------------------------------------------------------76// FORMAT UPTIME77// ----------------------------------------------------------78 79var uptimeParts = [];80 81if (days > 0) {82  uptimeParts.push(days + "d");83}84 85if (hours > 0) {86  uptimeParts.push(hours + "h");87}88 89if (minutes > 0) {90  uptimeParts.push(minutes + "m");91}92 93if (94  seconds > 0 ||95  uptimeParts.length === 096) {97  uptimeParts.push(seconds + "s");98}99 100var uptime = uptimeParts.join(" ");101 102// ----------------------------------------------------------103// EXECUTION TIME104// ----------------------------------------------------------105 106var executionTime = Math.max(107  0,108  Date.now() - pingStart109);110 111// ----------------------------------------------------------112// STATUS113// ----------------------------------------------------------114 115var status = "Online 🟢";116 117if (executionTime >= 1000) {118  status = "Slow 🟡";119}120 121// ----------------------------------------------------------122// SEND PING123// ----------------------------------------------------------124 125Bot.sendMessage({126  text:127    "🏓 <b>GIFT AI — PONG!</b>\n\n" +128 129    "⚡ <b>Response:</b> " +130    executionTime +131    " ms\n\n" +132 133    "⏱ <b>Uptime:</b> " +134    uptime +135    "\n\n" +136 137    "🤖 <b>Status:</b> " +138    status,139 140  parse_mode: "HTML"141});