mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 17:21:31 +00:00
fix joining voice channels without perms
This commit is contained in:
parent
650e21e907
commit
45632b2eae
1 changed files with 4 additions and 0 deletions
|
|
@ -80,6 +80,10 @@ class ClientVoiceManager {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (this.pending.get(channel.guild.id)) throw new Error('Already connecting to this guild\'s voice server.');
|
if (this.pending.get(channel.guild.id)) throw new Error('Already connecting to this guild\'s voice server.');
|
||||||
|
|
||||||
|
if (!channel.permissionsFor(this.client.user).hasPermission('CONNECT')) {
|
||||||
|
throw new Error('You do not have permission to join this voice channel');
|
||||||
|
}
|
||||||
|
|
||||||
const existingConnection = this.connections.get(channel.guild.id);
|
const existingConnection = this.connections.get(channel.guild.id);
|
||||||
if (existingConnection) {
|
if (existingConnection) {
|
||||||
if (existingConnection.channel.id !== channel.id) {
|
if (existingConnection.channel.id !== channel.id) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue