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

Function handler

plugins/reload.ts:9–26  ·  view source on GitHub ↗
(sock: any, message: any, _args: any)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

reloadCommandsMethod · 0.80

Tested by

no test coverage detected