Organize este código: var jsonfgp = JSON.parse(fs.readFileSync(./func/fgp-${from}.json))…
- User
Organize este código:
var json_fgp = JSON.parse(fs.readFileSync(
./func/fgp-${from}.json)) var hora_d_agr = moment.tz('America/Sao_Paulo').format('HH/mm/ss'); switch(hora_d_agr){ case json_fgp.abrirgp: { await client.groupSettingUpdate(from, 'not_announcement') var blamsgfgp =./func/horario-grupo-a-b/mensagem_de_abrir-fechar-${from}.jsonfs.writeFileSync(blamsgfgp, JSON.stringify("_- PROGRAMAÇÃO DE - \n\nFECHAR / ABRIR GRUPO\n\n- REALIZANDO AÇÃO _-", null, 2)) if(fs.existsSync(blamsgfgp)) { blarmsgfc = JSON.parse(fs.readFileSync(blamsgfgp)) } await client.sendMessage(from, {text: blarmsgfc}) fs.unlinkSync(blamsgfgp) } breakcase json_fgp.fechargp: { await client.groupSettingUpdate(from, 'announcement') var blamsgfgp =
./func/horario-grupo-a-b/mensagem_de_abrir-fechar-${from}.json
fs.writeFileSync(blamsgfgp, JSON.stringify("_- PROGRAMAÇÃO DE - \n\nFECHAR / ABRIR GRUPO\n\n- REALIZANDO AÇÃO _-", null, 2)) if(fs.existsSync(blamsgfgp)) { blarmsgfc = JSON.parse(fs.readFileSync(blamsgfgp)) } await client.sendMessage(from, {text: blarmsgfc}) fs.unlinkSync(blamsgfgp) } breakdefault: } } }
myinterval = setInterval(fgptotale, 1000) await setTimeout(async () => { clearInterval(myinterval); }, 1000) }
const horaAtual = moment().format('HH:mm:ss'); const dataAtual = moment().format('DD/MM/YYYY');
const quizzes = require('./quiz.json'); const quizzesPendentesPath = './quizzesPendentes.json'; let quizzesPendentes = {};
function carregarQuizzesPendentes() { if (fs.existsSync(quizzesPendentesPath)) { quizzesPendentes = JSON.parse(fs.readFileSync(quizzesPendentesPath)); } }
function salvarQuizzesPendentes() { fs.writeFileSync(quizzesPendentesPath, JSON.stringify(quizzesPendentes, null, 2)); }
function iniciarQuiz(sender, categoria, pergunta, resposta) { if (quizzesPendentes[sender]) { reply("Você já tem um quiz pendente! Responda o quiz atual antes de iniciar outro."); return false; }
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.