(sock, chatId, message)
| 19 | } |
| 20 | |
| 21 | async function pingCommand(sock, chatId, message) { |
| 22 | try { |
| 23 | // Measure ping |
| 24 | const start = Date.now(); |
| 25 | await sock.sendMessage(chatId, { text: '⚡ Pinging...' }, { quoted: message }); |
| 26 | const end = Date.now(); |
| 27 | const ping = Math.round(end - start); |
| 28 | |
| 29 | const uptimeInSeconds = process.uptime(); |
| 30 | const uptimeFormatted = formatTime(uptimeInSeconds); |
| 31 | |
| 32 | // Minimal output |
| 33 | const botInfo = ` |
| 34 | 𝐙𝐄𝐍𝐈𝐓𝐒𝐔 𝐁𝐎𝐓 🤖 |
| 35 | |
| 36 | ⚡ Ping : ${ping} ms |
| 37 | ⏱️ Uptime : ${uptimeFormatted} |
| 38 | 🆚 Version : v${settings.version} |
| 39 | `; |
| 40 | |
| 41 | await sock.sendMessage(chatId, { text: botInfo }, { quoted: message }); |
| 42 | |
| 43 | } catch (error) { |
| 44 | console.error('Error in ping command:', error); |
| 45 | await sock.sendMessage(chatId, { text: '❌ Could not get ping status.' }, { quoted: message }); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | module.exports = pingCommand; |
nothing calls this directly
no test coverage detected