MCPcopy Create free account
hub / github.com/Xchristech2/Zenitsu-Bot / goodbyeCommand

Function goodbyeCommand

commands/goodbye.js:5–18  ·  view source on GitHub ↗
(sock, chatId, message, match)

Source from the content-addressed store, hash-verified

3const fetch = require('node-fetch');
4
5async 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
20async function handleLeaveEvent(sock, id, participants) {
21 // Check if goodbye is enabled for this group

Callers

nothing calls this directly

Calls 1

handleGoodbyeFunction · 0.85

Tested by

no test coverage detected