(sock, chatId, message, match)
| 4 | const fetch = require('node-fetch'); |
| 5 | |
| 6 | async function welcomeCommand(sock, chatId, message, match) { |
| 7 | // Check if it's a group |
| 8 | if (!chatId.endsWith('@g.us')) { |
| 9 | await sock.sendMessage(chatId, { text: 'This command can only be used in groups.' }); |
| 10 | return; |
| 11 | } |
| 12 | |
| 13 | // Extract match from message |
| 14 | const text = message.message?.conversation || |
| 15 | message.message?.extendedTextMessage?.text || ''; |
| 16 | const matchText = text.split(' ').slice(1).join(' '); |
| 17 | |
| 18 | await handleWelcome(sock, chatId, message, matchText); |
| 19 | } |
| 20 | |
| 21 | async function handleJoinEvent(sock, id, participants) { |
| 22 | // Check if welcome is enabled for this group |
nothing calls this directly
no test coverage detected