Organize este código: let botNumber = ${client.user.id.split('@')[0]}} let cleanNumber =…
- User
Organize este código:
let botNumber =
${client.user.id.split('@')[0]}}let cleanNumber = botNumber.split(':')[0]; const getGroupMessage = (groupId, filePath) => { try { const data = JSON.parse(fs.readFileSync(filePath, 'utf8')); const group = data.find(group => group.id === groupId); if (group) { return group.msg; } else { console.log('\x1b[32mMensagem não definida para o grupo\x1b[0m'); return null; } } catch (error) { console.error(Erro ao ler o arquivo de mensagem: ${error}); return null; } } const formatMessage = (template, placeholders) => { if (!template) { return ''; } return template.replace(/#(.*?)#/g, (_, key) => placeholders[key] || ''); } const stickerWelcomeIDPath = './arquivos/funções/grupos/sticker_welcom.json'; const stickerCachePath = './armor/cache'; function loadOrCreateStickerJSON(filePath) { if (!fs.existsSync(filePath)) { fs.writeFileSync(filePath, JSON.stringify([])); } return JSON.parse(fs.readFileSync(filePath)); } const stickerWelcomIDs = loadOrCreateStickerJSON(stickerWelcomeIDPath); if (stickerWelcomIDs.includes(num.id) && num.action === 'add') { const welcomeStickerPath =${stickerCachePath}/${num.id}-welcome.webp; if (fs.existsSync(welcomeStickerPath)) { var selo_bv_sticker = { key: { fromMe: false, participant:@${num.participants[0].split('@')[0]}@s.whatsapp.net, }, message: { extendedTextMessage: { text:Seja bem-vindo @${num.participants[0].split('@')[0]}, ao grupo ${groupMetadata.subject}, }, }, };await client.sendMessage(num.id, { sticker: { url: welcomeStickerPath } }, { quoted: selo_bv_sticker }); }} if (stickerWelcomIDs.includes(num.id) && num.action === 'remove') {
- Assistant