(sock, message, args, context)
| 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 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected