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