// Komandy, který buď nějakým způsobem mění funkci nebo "vzhled" bota // nebo donutí bota něco udělat (odeslání zprávy s výsledkem nebo smazání originální zprávy se nepočítá) const zarizeni = { desktop: 'Počítač', mobile: 'Mobil', web: 'Web' }; const statusy = { online: '🟢', idle: '🟡', dnd: '🔴' }; const changeStatus = (mes, status) => { mes.client.user.setStatus(status); return "ano pane"; }; const changeActivity = (mes, activity, txt) => { mes.client.user.setActivity(txt, activity); mes.react("730175107313565717"); return "ano pane"; }; const ping = /^<@!?\d+>$/; module.exports = { more_komandy: { online: { als: ["onlajn", "zelenej"], run: (_, mes) => changeStatus(mes, "online") }, idle: { als: ["žlutej", "zlutej", "afk", "idle", "nepřítomnej", "nepritomnej"], run: (_, mes) => changeStatus(mes, "idle") }, dnd: { als: ["nerusit", "nerušit", "červenej", "cervenej"], run: (_, mes) => changeStatus(mes, "dnd") }, offline: { als: ["oflajn", "neviditelnej"], run: (_, mes) => changeStatus(mes, "invisible") }, hraj: (arg, mes) => changeActivity(mes, "PLAYING", arg), sleduj: (arg, mes) => changeActivity(mes, "WATCHING", arg), poslouchej: (arg, mes) => changeActivity(mes, "LISTENING", arg), soutez: { als: ["soutěž"], run: (arg, mes) => changeActivity(mes, "COMPETING", arg) }, nedelej: (_, mes) => changeActivity(mes, ""), fight: { als: ["figh", "fajt"], run: (arg, mes) => { if (!ping.test(arg)) return 'tak si kokot ti kokote'; const vyherce = Math.random() < 0.5 ? mes.author : arg; return `tento figh vyhrál: ${vyherce}!`; } }, status: (arg, mes) => { if (!ping.test(arg)) return 'tak si kokot ti kokote'; const uzivatel = mes.mentions.users.first(); const embed = { title: `Informace o statusech pro ${uzivatel.username}:`, color: 431075 }; const presence = uzivatel.presence.clientStatus; if (!presence) { embed.description = '*Všude je offline*'; } else { const uStatusy = []; Object.keys(presence).forEach(status => { uStatusy.push(`${zarizeni[status]}: ${statusy[presence[status]]}`); }); embed.description = uStatusy.join('\n'); } return { embed }; }, zareaguj: { als: ["react"], run: (arg, mes) => { if (!arg) return 'retard'; const emouty = arg.match(//g); if (!emouty) return 'retard'; let naCo; (async () => { if (mes.reference) { naCo = await mes.channel.messages.fetch(mes.reference.messageID); } else { const msgs = [...mes.channel.messages.cache.values()]; naCo = msgs[msgs.length - 2]; } mes.delete(); emouty.forEach(emout => naCo.react(emout)); })(); } }, odpocitej: (_, mes) => { const randomshit = (dalsi, argument) => { dalsi.edit(argument[0]); argument.splice(0, 1); if (argument.length) setTimeout(() => randomshit(dalsi, argument), 1000); }; mes.channel.send(":stop_button:").then(mes => randomshit(mes, [":five:", ":four:", ":three:", ":two:", ":one:", ":ok:"])); }, pocasi: { als: ["počasí"], run: _ => { const embed = { title: "Počasí", image: { url: "attachment://pocasi.png" } }; return { embed, files: ["https://util.deadfish.cz/morepocasi/v/49.4348358/12.8147250/pocasi.png"] }; } } } };