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