Organize este código: fs.writeFileSync(./armor/quizanim-${from}.json,…
- User
Organize este código:
fs.writeFileSync(
./armor/quizanim-${from}.json,${JSON.stringify(quizanimais[Math.floor(Math.random() * quizanimais.length)])}) let dataAnagrama2 = JSON.parse(fs.readFileSync(./armor/quizanim-${from}.json)) imagemtexto =「❓Quiz❓」await client.sendMessage(from, {image: {url: dataAnagrama2.foto}, caption: imagemtexto, thumbnail: null}, {quoted: selo}) }, 5000) } }// FUNÇÃO DE ALUGUEL
function alugar(idGrupo, tempo) { const aluguel = { idGrupo: idGrupo, tempo: tempo, horaAluguel: new Date().getTime() }; let alugueis = []; if (fs.existsSync('./arquivos/funções/grupos/aluguel.json')) { const data = fs.readFileSync('./arquivos/funções/grupos/aluguel.json', 'utf8'); alugueis = JSON.parse(data); } alugueis.push(aluguel); fs.writeFileSync('./arquivos/funções/grupos/aluguel.json', JSON.stringify(alugueis)); }
function removerAluguel(idGrupo) { const dadosAlugueis = fs.readFileSync('./arquivos/funções/grupos/aluguel.json', 'utf8'); let listaAlugueis = JSON.parse(dadosAlugueis); listaAlugueis = listaAlugueis.filter(aluguel => aluguel.idGrupo !== idGrupo); fs.writeFileSync('./arquivos/funções/grupos/aluguel.json', JSON.stringify(listaAlugueis)); reply(
Registro de aluguel do grupo ${idGrupo} removido.); }function exibirListaAlugueis() { const dadosAlugueis = fs.readFileSync('./arquivos/funções/grupos/aluguel.json', 'utf8'); const listaAlugueis = JSON.parse(dadosAlugueis); let agora = new Date().getTime(); let mensagemLista = 'Lista de Aluguéis:\n'; listaAlugueis.forEach(aluguel => { const horaAluguel = aluguel.horaAluguel; const tempo = aluguel.tempo; const idGrupo = aluguel.idGrupo; let tempoRestante; if (tempo.endsWith('d')) { tempoRestante = Math.ceil((horaAluguel + parseInt(tempo) * 24 * 60 * 60 * 1000 - agora) / (24 * 60 * 60 * 1000));
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.