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

Function handler

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

Source from the content-addressed store, hash-verified

9 description: 'Hide text using read more',
10 usage: '.readmore text\n.readmore text1|text2',
11 async handler(sock: any, message: any, args: any, context: BotContext) {
12 const chatId = context.chatId || message.key.remoteJid;
13 const text = args.join(' ').trim();
14 if (!text) {
15 return await sock.sendMessage(
16 chatId,
17 { text: 'Usage:\n.readmore text\n.readmore text1|text2' },
18 { quoted: message }
19 );
20 }
21 let output;
22 if (text.includes('|')) {
23 const parts = text.split('|');
24 const firstPart = parts.shift();
25 const rest = parts.join('|');
26 output = firstPart + readMore + rest;
27 } else {
28 output = text + readMore;
29 }
30 await sock.sendMessage(chatId, { text: output }, { quoted: message });
31 }
32};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected