42 lines
1.4 KiB
JavaScript
42 lines
1.4 KiB
JavaScript
// Komandy nebo handelery který se nikam jinam nehodí
|
|
|
|
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.client.voice?.connections.values()].forEach(con => con.disconnect());
|
|
mes.react("👋")
|
|
.then(() => process.exit());
|
|
break;
|
|
|
|
default:
|
|
return false;
|
|
}
|
|
return true;
|
|
},
|
|
|
|
// 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)])
|
|
.catch(er => console.log("neco se doebalo:", er.message));
|
|
}
|
|
};
|