Organize este código: client.sendMessage(groupId, "Erro! Use um intervalo válido como…
- User
Organize este código:
codeclient.sendMessage(groupId, "Erro! Use um intervalo válido como 1m, 1h, 1d."); return; } if (scheduleMap.has(groupId)) { clearInterval(scheduleMap.get(groupId)); } const schedule = setInterval(() => buscarHorariosEEnviar(gameName, intervalo, groupId), tempoMs); scheduleMap.set(groupId, schedule); client.sendMessage(groupId, { text: `✅ Agendamento iniciado para *${gameName === 'all' ? 'Todos os Jogos' : gameName}* a cada *${intervalo}*.`});}
function converterIntervaloParaMs(intervalo) { const regex = /^(\d+)(s|m|h|d)$/i; const match = intervalo.match(regex); if (!match) return null;
codeconst valor = parseInt(match[1]); const unidade = match[2].toLowerCase(); switch (unidade) { case 's': return valor * 1000; case 'm': return valor * 60 * 1000; case 'h': return valor * 60 * 60 * 1000; case 'd': return valor * 24 * 60 * 60 * 1000; default: return null; }}
const interacaoFilePath = './interacao.json'; let interacaoData = JSON.parse(fs.readFileSync(interacaoFilePath));
function saveInteracaoData() { fs.writeFileSync(interacaoFilePath, JSON.stringify(interacaoData, null, 4)); }
if (!isBot) { const now = new Date(); const hours = now.getHours();
codeconst noInteraction = interacaoData.noInteractionGroups.includes(from); if (!noInteraction) { if (budy.startsWith("bom dia") || budy.startsWith("Bom dia") || budy.startsWith("BOM DIA")) { await reply(`Bom dia ${pushname}`); } else if (budy.startsWith("boa tarde") || budy.startsWith("Boa tarde") || budy.startsWith("BOA TARDE")) { if (hours < 12) { await reply("Ainda não é tarde, mas bom dia!"); } else if (hours >= 12 && hours < 18) { await reply(`Boa tarde ${pushname}`); } else { await reply("Já é noite, então boa noite!"); } - Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.