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

Function handler

plugins/cmdreact.js:14–37  ·  view source on GitHub ↗
(sock, message, args, context)

Source from the content-addressed store, hash-verified

12 usage: '.creact on/off',
13 ownerOnly: true,
14 async handler(sock, message, args, context) {
15 const { chatId, channelInfo } = context;
16 if (!args[0] || !['on', 'off'].includes(args[0])) {
17 await sock.sendMessage(chatId, {
18 text: `*Usage:*\n.creact on/off\n\nStorage: ${HAS_DB ? 'Database' : 'File System'}`,
19 ...channelInfo
20 }, { quoted: message });
21 return;
22 }
23 if (args[0] === 'on') {
24 await setCommandReactState(true);
25 await sock.sendMessage(chatId, {
26 text: `*✅ Command reactions enabled*\n\nStorage: ${HAS_DB ? 'Database' : 'File System'}`,
27 ...channelInfo
28 }, { quoted: message });
29 }
30 else if (args[0] === 'off') {
31 await setCommandReactState(false);
32 await sock.sendMessage(chatId, {
33 text: `*❌ Command reactions disabled*\n\nStorage: ${HAS_DB ? 'Database' : 'File System'}`,
34 ...channelInfo
35 }, { quoted: message });
36 }
37 }
38};

Callers

nothing calls this directly

Calls 1

setCommandReactStateFunction · 0.90

Tested by

no test coverage detected