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

Function handler

plugins/resetlink.js:9–25  ·  view source on GitHub ↗
(sock, message, args, context)

Source from the content-addressed store, hash-verified

7 groupOnly: true,
8 adminOnly: true,
9 async handler(sock, message, args, context) {
10 const { chatId, channelInfo } = context;
11 try {
12 const newCode = await sock.groupRevokeInvite(chatId);
13 await sock.sendMessage(chatId, {
14 text: `✅ Group link has been successfully reset\n\n🔗 New link:\nhttps://chat.whatsapp.com/${newCode}`,
15 ...channelInfo
16 }, { quoted: message });
17 }
18 catch (error) {
19 console.error('Error in resetlink command:', error);
20 await sock.sendMessage(chatId, {
21 text: 'Failed to reset group link!',
22 ...channelInfo
23 }, { quoted: message });
24 }
25 }
26};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected