Spaces:
Paused
Paused
Download src/plugin/ping.js from arabdullah/ethix-md-user-4: direct link, hf CLI and curl.
- Browser
- Download file 629 Bytes
-
https://huggingface.co/spaces/arabdullah/ethix-md-user-4/resolve/main/src/plugin/ping.js
- Command line
-
hf download hf://spaces/arabdullah/ethix-md-user-4/src/plugin/ping.js
-
curl -L -o ping.js https://huggingface.co/spaces/arabdullah/ethix-md-user-4/resolve/main/src/plugin/ping.js
629 Bytes
| import config from '../../config.cjs'; | |
| const ping = async (m, sock) => { | |
| const prefix = config.PREFIX; | |
| const cmd = m.body.startsWith(prefix) ? m.body.slice(prefix.length).split(' ')[0].toLowerCase() : ''; | |
| const text = m.body.slice(prefix.length + cmd.length).trim(); | |
| if (cmd === "ping") { | |
| const start = new Date().getTime(); | |
| await m.React('⚡'); | |
| const end = new Date().getTime(); | |
| const responseTime = (end - start) / 1000; | |
| const text = `*_🔥⃝вσт ѕρєє∂: ${responseTime.toFixed(2)} s_*`; | |
| sock.sendMessage(m.from, { text }, { quoted: m }); | |
| } | |
| } | |
| export default ping; | |