(Optimized?) voice kicking on spink
This commit is contained in:
parent
5fd14f4043
commit
2d9a2f6738
@ -95,14 +95,16 @@ module.exports = {
|
|||||||
if (mes.content[0] !== 's') return;
|
if (mes.content[0] !== 's') return;
|
||||||
const uzivatel = mes.content.match(/(?<=discord_)\d+/)?.[0];
|
const uzivatel = mes.content.match(/(?<=discord_)\d+/)?.[0];
|
||||||
if (!uzivatel) return;
|
if (!uzivatel) return;
|
||||||
[...mes.client.guilds.cache.values()].forEach(guild => {
|
for (const [_, guild] of mes.client.guilds.cache) {
|
||||||
[...guild.channels.cache.values()].filter(ch => ch.type === 'voice').forEach(channel => {
|
for (const [_, channel] of guild.channels.cache) {
|
||||||
[...channel.members.values()].forEach(user => {
|
if (channel.type !== "voice") continue;
|
||||||
if (user.user.id !== uzivatel) return;
|
for (const [_, member] of channel.members) {
|
||||||
user.voice.kick('spinkacek');
|
if (member.id !== uzivatel) continue;
|
||||||
});
|
member.voice.kick("spinkacek");
|
||||||
});
|
return;
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user