mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-02 00:50:09 +00:00
feat(GuildMember): Add timeouts (#7104)
Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com> Co-authored-by: Tiemen <ThaTiemsz@users.noreply.github.com> Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -68,8 +68,16 @@ class BaseGuildVoiceChannel extends GuildChannel {
|
||||
*/
|
||||
get joinable() {
|
||||
if (!this.viewable) return false;
|
||||
if (!this.permissionsFor(this.client.user).has(Permissions.FLAGS.CONNECT, false)) return false;
|
||||
return true;
|
||||
const permissions = this.permissionsFor(this.client.user);
|
||||
if (!permissions) return false;
|
||||
|
||||
// This flag allows joining even if timed out
|
||||
if (permissions.has(Permissions.FLAGS.ADMINISTRATOR, false)) return true;
|
||||
|
||||
return (
|
||||
this.guild.me.communicationDisabledUntilTimestamp < Date.now() &&
|
||||
permissions.has(Permissions.FLAGS.CONNECT, false)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user