Aqui está o código reorganizado e formatado para melhor legibilidade. Eu adicionei espaços, quebras de linha e comentários para facilitar a compreensão do fluxo e da lógica.
// Envio de mensagem para configuração do Anti-Sticker
buttonMessage02 = {
text: `╭═─────═⌘═────═╮
👑 𝐀𝐍𝐓𝐈 STICKER 👑
𝐔𝐒𝐔Á𝐑𝐈𝐎: ${pushname}
𝐆𝐑𝐔𝐏𝐎: ${groupName}
╰═─────═⌘═────═╯
`,
footer: `STATUS DO ANTI-STICKER AGORA: ${isAntiSticker ? 'ATIVADO' : 'DESATIVADO'}\n`,
buttons: buttons02,
headerType: 4,
contextInfo: { forwardingScore: 999, isForwarded: true }
};
client.sendMessage(from, buttonMessage02, { quoted: info });
break;
case 'antiimg':
if (!isGroup) return reply(resposta.grupo);
if (!isGroupAdmins) return reply(resposta.adm);
if (!isBotGroupAdmins) return reply(resposta.botadm);
if (Number(args[0]) === 1) {
// Ativar o recurso de anti-imagem
if (isAntiImg) {
return reply('Já está ativo.');
}
antiimg.push(from);
fs.writeFileSync('./arquivos/funções/antiimg.json', JSON.stringify(antiimg));
reply('🎗 Ativou com sucesso o recurso de anti imagem nesse grupo 🎗');
} else if (Number(args[0]) === 0) {
// Desativar o recurso de anti-imagem
if (!isAntiImg) {
return reply('Já está desativado.');
}
antiimg.splice(from, 1);
fs.writeFileSync('./arquivos/funções/antiimg.json', JSON.stringify(antiimg));
reply('🎗 Desativou com sucesso o recurso de anti imagem nesse grupo 🎗');
} else {
// Mostrar status atual do anti-imagem
buttons002 = [
{ buttonId: `${prefix + command} ${isAntiImg ? '0' : '1'}`, buttonText: { displayText: isAntiImg ? '[🎗] DESATIVAR [🎗]' : '[🎗] ATIVAR [🎗]' }, type: 1 }
];
buttonMessage02 = {
text: `╭═─────═⌘═────═╮
👑 𝐀𝐍𝐓𝐈 𝐈𝐌𝐀𝐆𝐄𝐌 👑
𝐔𝐒𝐔Á𝐑𝐈𝐎: ${pushname}
𝐆𝐑𝐔𝐏𝐎: ${groupName}
╰═─────═⌘═────═╯`,
footer: `STATUS DO ANTI-IMG AGORA: ${isAntiImg ? 'ATIVADO' : 'DESATIVADO'}\n`,
buttons: buttons002,
headerType: 4,
contextInfo: { forwardingScore: 999, isForwarded: true }
};
client.sendMessage(from, buttonMessage02, { quoted: info });
}
break;
case 'tagall':
case 'marcar': {
// Verificação de permissões e envio de lista de marcadores
if (!isGroup) return reply(resposta.group);
if (!isGroupAdmins) return reply(resposta.adm);
let metadata = await client.groupMetadata(from);
let tall = `
👥 *MARCANDEIROS DO GRUPO* 👥
`;
// Aqui você pode adicionar lógica para listar todos os membros do grupo...
}
// Continue com o restante do código...
Essa reorganização melhora a estrutura do código, facilitando a leitura e manutenção. Certifique-se de que o código ainda funcione conforme esperado após a reorganização.