(sock: any, message: any, args: any)
| 7 | isPrefixless: true, |
| 8 | |
| 9 | async handler(sock: any, message: any, args: any) { |
| 10 | const chatId = message.key.remoteJid; |
| 11 | |
| 12 | if (args.length < 2) { |
| 13 | return await sock.sendMessage(chatId, { text: 'Usage: .echo <text> <count>' }, { quoted: message }); |
| 14 | } |
| 15 | |
| 16 | const count = parseInt(args[args.length - 1], 10); |
| 17 | if (isNaN(count) || count <= 0) { |
| 18 | return await sock.sendMessage(chatId, { text: 'Count must be a positive number.' }, { quoted: message }); |
| 19 | } |
| 20 | |
| 21 | args.pop(); |
| 22 | const text = args.join(' ').trim(); |
| 23 | |
| 24 | const repeated = Array(count).fill(text).join('\n'); |
| 25 | await sock.sendMessage(chatId, { text: repeated }, { quoted: message }); |
| 26 | } |
| 27 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected