Added more status

This commit is contained in:
Histmy 2021-02-06 23:41:34 +01:00
parent 0e2268177a
commit 2e8df16ff7

View File

@ -40,6 +40,32 @@ module.exports = (mes, komand, celArgs) => {
mes.channel.send('toto me trickeruje');
break;
case 'status':
const ping = /^<@!?\d+>$/;
if (!ping.test(celArgs)) {
mes.channel.send('tak si kokot ti kokote');
break;
}
const uzivatel = mes.mentions.users.first();
const embed = {
title: `Informace o statusech pro ${uzivatel.username}:`,
color: 431075
};
const zarizeni = { desktop: 'Počítač', mobile: 'Mobil', web: 'Web' };
const statusy = { online: '🟢', idle: '🟡', dnd: '🔴' };
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');
}
mes.channel.send({ embed });
break;
default:
return false;
}