Organize este código: case 'imgprogramada': { await verificarEExecutar(async () => { if…
- User
Organize este código:
case 'imgprogramada': { await verificarEExecutar(async () => { if (!isGroup) return reply('Este comando só pode ser utilizado em grupos.'); if (!isGroupAdmins) return reply('Apenas administradores podem usar este comando.'); if (!isQuotedImage) return reply('Por favor, marque uma imagem.'); if (!q) return reply('Está faltando o minuto, hora, etc. em que o robô vai enviar a imagem!'); const interval = q; if (!interval) return reply('Por favor, forneça um intervalo de tempo válido.'); try { const imageMessage = JSON.parse(JSON.stringify(info).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo.message.imageMessage; const imageBuffer = await getFileBuffer(imageMessage, "image"); if (!Buffer.isBuffer(imageBuffer)) throw new Error('A imagem não está em formato de buffer.'); const imageUrl = await uploadImageToTelegraph(imageBuffer); saveImageSchedule(from, interval, imageUrl); reply(
A imagem foi enviada com sucesso para o Uguu e será programada para envio em ${interval}.); } catch (error) { console.error(error); reply('Ocorreu um erro ao processar a imagem. Por favor, tente novamente.'); } }); break; }case 'resposta_automatica': { await verificarEExecutar(async () => { if (args.length < 1) return reply('1 pra ligar / 0 pra desligar'); if (Number(args[0]) === 1) { if (isAuto_resposta) return reply('Já está ativo'); auto_resposta.push(from); fs.writeFileSync('./arquivos/funções/auto_resposta.json', JSON.stringify(auto_resposta)); reply('🌀 Ativou com sucesso o recurso de auto_resposta 📝'); } else if (Number(args[0]) === 0) { if (!isAuto_resposta) return reply('Já está desativado'); const index = auto_resposta.indexOf(from); if (index > -1) { auto_resposta.splice(index, 1); fs.writeFileSync('./arquivos/funções/auto_resposta.json', JSON.stringify(auto_resposta)); reply('‼️ Desativou com sucesso o recurso de auto_resposta ✔️'); } } else enviar('1 para ativar, 0 para desativar'); }); break; }
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.