// Modul dedikovaný funkci spinkáček

const spinkacky = [];

module.exports = {
  more_komand: (mes, komand) => {
  switch (komand) {
    case 'spinkáček':
    case 'spinkacek':
      if (mes.author.bot) {
        mes.channel.send('<:delassibazny:643059863059955723>');
        break;
      }

      if (spinkacky.includes(mes.author.id)) {
        mes.channel.send('nespis uz?????');
        break;
      }

      if (mes.member.voice.channel) mes.member.voice.kick('spinkacek');
      spinkacky.push(mes.author.id);
      mes.react('😴');
      break;

    case 'vstáváček':
    case 'vstavacek':
      if (!spinkacky.includes(mes.author.id)) {
        mes.channel.send('uz jsi vzhuru ty hajzle');
        break;
      }
      spinkacky.splice(spinkacky.indexOf(mes.author.id), 1);
      mes.channel.send('dobre rano hajzle');
      break;

    default:
      return false;
    }
    return true;
  },

  on_voiceStateUpdate: (bef, aft) => {
    if (!aft.channel || bef.channel) return;
    if (spinkacky.includes(aft.id)) aft.kick();
    },
}
