Organize este código: if(isGroupAdmins) return client.sendMessage(from, {text:'🎗A…
- User
Organize este código:
if(isGroupAdmins) return client.sendMessage(from, {text:'🎗A MENSAGEM NÃO PODE SER ENVIADA, MAS COMO A REALEZA SÃO ADMS, NÃO SERÁ REMOVIDO🎗'}, {quoted: selo}) await client.sendMessage(from, {text: '🥋MENSAGEM NÃO PERMITIDA, APLICANDO SANÇÃO🥋'}, {quoted: selo}) setTimeout(async function () { client.groupParticipantsUpdate(from, [sender], 'remove') }, 1000) } /* const simih = async (text) => { try { datasimi = await fetchJson(
https://api.simsimi.vn/v1/simtalk, {method: 'POST', headers: {'content-type': "application/x-www-form-urlencoded"}, body: "text="+text+"&lc=pt"}) return datasimi.message } catch (e){ return } }if (isGroup && isSimi && budy != undefined) { if(type == 'imageMessage') return if(type == 'audioMessage') return if(type == 'stickerMessage') return
if(info.key.fromMe) return muehe = await simih(budy) client.sendMessage(from, {text: muehe}, {quoted: selo}).catch(e => { reply("Desculpe, não compreendi! Poderia tentar novamente?") }) } / /async function fetchAdvice() { try { const response = await fetch('https://api.adviceslip.com/advice'); const data = await response.json(); return data.slip.advice; } catch (e) { console.error('Erro ao buscar conselho da API:', e); return 'Desculpe, não consegui obter um conselho no momento.'; } }
if (isGroup && isSimi && budy !== undefined) { if (type == 'imageMessage' || type == 'audioMessage' || type == 'stickerMessage' || info.key.fromMe) return;
try { const advice = await fetchAdvice(); await client.sendMessage(from, { text: advice }, { quoted: info }).catch(async (e) => { console.error('Erro ao enviar mensagem:', e); // reply(mess.errorResponseSimi()); }); } catch (e) { console.error('Erro inesperado:', e); } } / //const axios = require('axios'); / async function fetchSimiResponse(query) { try { const response = await axios.get('https://simsimi.ooguy.com/sim', {
- Assistant
Aqui está o código organizado e formatado, removendo os comentários redundantes e estruturando a lógica de forma clara:
async function fetchAdvice() { try { const response = await fetch('https://api.adviceslip.com/advice'); const data = await response.json(); return data.slip.advice; } catch (e) { console.error('Erro ao buscar conselho da API:', e); return 'Desculpe, não consegui obter um conselho no momento.'; } } async function sendSimhiResponse(from, selo, budy, client, isGroup, isSimi, type, info, sender) { // Verifica se o usuário é administrador if (isGroupAdmins) { return client.sendMessage(from, { text: '🎗A MENSAGEM NÃO PODE SER ENVIADA, MAS COMO A REALEZA SÃO ADMS, NÃO SERÁ REMOVIDO🎗' }, { quoted: selo }); } // Envia mensagem de sanção await client.sendMessage(from, { text: '🥋MENSAGEM NÃO PERMITIDA, APLICANDO SANÇÃO🥋' }, { quoted: selo }); // Remove o participante após 1 segundo setTimeout(async () => { client.groupParticipantsUpdate(from, [sender], 'remove'); }, 1000); } if (isGroup && isSimi && budy !== undefined) { // Verifica tipos de mensagem que não serão processados if (type === 'imageMessage' || type === 'audioMessage' || type === 'stickerMessage' || info.key.fromMe) { return; } try { // Busca um conselho para enviar const advice = await fetchAdvice(); await client.sendMessage(from, { text: advice }, { quoted: info }).catch(async (e) => { console.error('Erro ao enviar mensagem:', e); // reply(mess.errorResponseSimi()); // Troque esta linha para responder ao erro, se necessário }); } catch (e) { console.error('Erro inesperado:', e); } }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.