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

Function welcomeCommand

commands/welcome.js:6–19  ·  view source on GitHub ↗
(sock, chatId, message, match)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

handleWelcomeFunction · 0.85

Tested by

no test coverage detected