File size: 761 Bytes
0ee7b04 72ee6f0 0ee7b04 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
import axios from "axios";
async function delay(ms) {
return new Promise((r) => setTimeout(r, ms));
}
export default {
command: ["ping", "p"],
description: "Cek respon bot",
example: "%p%cmd",
name: "ping",
tags: "other",
run: async (m, { conn }) => {
try {
const start = Date.now();
m.reply("β³ Mengukur ping...");
// Simulasi delay kecil biar terasa natural
await delay(200);
const end = Date.now();
const ping = end - start;
await conn.sendMessage(
m.from,
{ text: `π Pong!\nπ‘ *${ping}ms*` },
{ quoted: m }
);
} catch (e) {
console.error(e);
await m.reply("Terjadi kesalahan: " + e.message);
}
},
}; |