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

Function handler

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

Source from the content-addressed store, hash-verified

6 usage: '.reload',
7 ownerOnly: true,
8 async handler(sock, message, _args) {
9 const chatId = message.key.remoteJid;
10 const commandHandler = (await import('../lib/commandHandler.js')).default;
11 try {
12 const start = Date.now();
13 commandHandler.reloadCommands();
14 const end = Date.now();
15 await sock.sendMessage(chatId, {
16 text: `✅ Reloaded ${commandHandler.commands.size} commands in ${end - start}ms`
17 });
18 }
19 catch (error) {
20 await sock.sendMessage(chatId, {
21 text: `❌ Reload failed: ${error.message}`
22 });
23 }
24 }
25};

Callers

nothing calls this directly

Calls 1

reloadCommandsMethod · 0.80

Tested by

no test coverage detected