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

Function handler

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected