Reorganize este código JS mantendo a lógica, mas melhorando a estrutura: } if (isGroup…
- User
Reorganize este código JS mantendo a lógica, mas melhorando a estrutura:
} if (isGroup && isLevelingOn) { const currentLevel = getLevelingLevel(sender) const checkId = getLevelingId(sender) try { if (currentLevel === undefined && checkId === undefined) addLevelingId(sender) const amountXp = Math.floor(Math.random() * 10) + 500 const requiredXp = 10000 * (Math.pow(2, currentLevel) - 1) const getLevel = getLevelingLevel(sender) const path = require('path'); const userRPGFile = './jogadores/user-rpg.json'; addLevelingXp(sender, amountXp) if (requiredXp <= getLevelingXp(sender)) { addLevelingLevel(sender, 1) await reply(
*「 LEVEL UP 」*\n\n➸ *Nome*: ${sender}\n➸ *XP*: ${getLevelingXp(sender)}\n➸ *Level*: ${getLevel} -> ${getLevelingLevel(sender)}\n\nParabéns!! 🎉🎉) } } catch (err) { console.error(err) } }const getLevel = getLevelingLevel(sender) const tictactoe = JSON.parse(fs.readFileSync('./arquivos/database/tictactoe.json'));
/////////////////////////////////////////////// // IS DE FUNÇÕES PARA ADM ///////////////////////////////////////////////
const forca = JSON.parse(fs.readFileSync('./arquivos/funções/grupos/forca.json')) const puppet = JSON.parse(fs.readFileSync('./arquivos/funções/grupos/puppet_forca.json')) const allForcaId = [] for(let obj of forca) allForcaId.push(obj.id) const isPlayForca = allForcaId.indexOf(sender) >= 0 ? true : false const samih2 = JSON.parse(fs.readFileSync('./arquivos/lib/simi.json')); const isSimi2 = isGroup ? samih2.includes(from) : false const isAntilinkgp = isGroup ? antilinkgp.includes(from) : true const isAntilink_adv = isGroup ? antilink_adv.includes(from) : true const isAntilinkgp2 = isGroup ? antilinkgp2.includes(from) : false const isAntiFlood = isGroup ? flood.includes(from) : false const isAntiVenda = isGroup ? antivendas.includes(from) : false const isLoading = isGroup ? loading.includes(from) : false const isCarregamento = isGroup ? carregamento.includes(from) : false const Antidoc = isGroup ? antidoc.includes(from) : false const isVisumsg = isGroup ? mdvisumsg.includes(from) : 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.