MCPcopy Create free account
hub / github.com/GlobalTechInfo/MEGA-MD / handler

Function handler

plugins/ping.js:8–19  ·  view source on GitHub ↗
(sock, message, _args)

Source from the content-addressed store, hash-verified

6 usage: '.ping',
7 isPrefixless: true,
8 async handler(sock, message, _args) {
9 const start = Date.now();
10 const chatId = message.key.remoteJid;
11 const sent = await sock.sendMessage(chatId, {
12 text: 'Pinging...'
13 });
14 const end = Date.now();
15 await sock.sendMessage(chatId, {
16 text: `🏓 Pong!\nLatency: ${end - start}ms`,
17 edit: sent.key
18 });
19 }
20};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected