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

Function handler

plugins/resetlink.ts:11–29  ·  view source on GitHub ↗
(sock: any, message: any, args: any, context: BotContext)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected