// Komandy nebo handelery který se nikam jinam nehodí const role = { online: '684443816383610916', idle: '684444083065978941', dnd: '684444020558135399', offline: '684443903759614049', onlinephone: '777989420728975390', idlephone: "836554207342362626", dndphone: "836554469478760449" }; const spoustece = ['mares', 'mareš', 'purfie', 'denim', '<@!477202009066438668>']; const emouty = ['purfiek3:616026189269696512', 'purfiek3:616026189269696512', 'purfiek3:616026189269696512', 'purfieUchyl:576487602203525138', 'bafW:574646319696576532', 'purfiek4:616026180889477258']; const rand = max => Math.floor(Math.random() * max); module.exports = { more_komand: (mes, komand, celArgs) => { switch (komand) { case 'debug_log': console.log('log: ', celArgs); mes.channel.send('je to v konzoli'); break; case "update": if (mes.channel.id != process.env.ADMIN_CHANNEL && mes.author.id != process.env.ADMIN_ID) { mes.channel.send("nato nemas prava kokote"); break; } mes.channel.send("👋") .then(() => process.exit()); break; default: return false; } return true; }, // Změna rolí podle statusu on_presenceUpdate: (bef, aft) => { if (aft.guild.id !== '555779161067749446' || process.env.IGNORE_PRESENCE) return; if (!bef) bef = { status: 'offline', clientStatus: {} }; [bef, aft].forEach(s => { const mobile = s.clientStatus.mobile; if (mobile && mobile !== s.clientStatus.desktop) s.status = `${mobile}phone`; }); if (bef.status === aft.status) return; aft.member.roles.add(role[aft.status]); aft.member.roles.remove(role[bef.status]); }, // Zareaguje na zprávu pokud obsahuje spouštěče a pokud RNG on_message: mes => { let sance = 0; spoustece.forEach(sp => { if (mes.content.toLowerCase().includes(sp)) sance++; }); if (rand(3) < sance) mes.react(emouty[rand(emouty.length)]); } }