Added phone roles for all statuses

This commit is contained in:
Histmy 2021-04-27 19:01:49 +02:00
parent 1c1157893e
commit eb018782c7

View File

@ -1,6 +1,6 @@
// Komandy nebo handelery který se nikam jinam nehodí // Komandy nebo handelery který se nikam jinam nehodí
const role = { online: '684443816383610916', idle: '684444083065978941', dnd: '684444020558135399', offline: '684443903759614049', onlinephone: '777989420728975390' }; const role = { online: '684443816383610916', idle: '684444083065978941', dnd: '684444020558135399', offline: '684443903759614049', onlinephone: '777989420728975390', idlephone: "836554207342362626", dndphone: "836554469478760449" };
const spoustece = ['mares', 'mareš', 'purfie', 'denim', '<@!477202009066438668>']; const spoustece = ['mares', 'mareš', 'purfie', 'denim', '<@!477202009066438668>'];
const emouty = ['purfiek3:616026189269696512', 'purfiek3:616026189269696512', 'purfiek3:616026189269696512', 'purfieUchyl:576487602203525138', 'bafW:574646319696576532', 'purfiek4:616026180889477258']; const emouty = ['purfiek3:616026189269696512', 'purfiek3:616026189269696512', 'purfiek3:616026189269696512', 'purfieUchyl:576487602203525138', 'bafW:574646319696576532', 'purfiek4:616026180889477258'];
const rand = max => Math.floor(Math.random() * max); const rand = max => Math.floor(Math.random() * max);
@ -23,8 +23,10 @@ module.exports = {
if (aft.guild.id !== '555779161067749446' || process.env.IGNORE_PRESENCE) return; if (aft.guild.id !== '555779161067749446' || process.env.IGNORE_PRESENCE) return;
if (!bef) bef = { status: 'offline', clientStatus: {} }; if (!bef) bef = { status: 'offline', clientStatus: {} };
if (bef.clientStatus.mobile === 'online' && bef.clientStatus.desktop !== 'online') bef.status = 'onlinephone'; [bef, aft].forEach(s => {
if (aft.clientStatus.mobile === 'online' && aft.clientStatus.desktop !== 'online') aft.status = 'onlinephone'; const mobile = s.clientStatus.mobile;
if (mobile && mobile !== s.clientStatus.desktop) s.status = `${mobile}phone`;
});
if (bef.status === aft.status) return; if (bef.status === aft.status) return;
aft.member.roles.add(role[aft.status]); aft.member.roles.add(role[aft.status]);