mirror of
https://github.com/danbulant/discord.js
synced 2026-06-07 16:52:16 +00:00
Teensy weensy cleanup
This commit is contained in:
parent
071e287fec
commit
83bef4ca77
1 changed files with 2 additions and 5 deletions
|
|
@ -55,7 +55,7 @@ class ClientVoiceManager {
|
||||||
throw new Error('There is no permission set for the client user in this channel - are they part of the guild?');
|
throw new Error('There is no permission set for the client user in this channel - are they part of the guild?');
|
||||||
}
|
}
|
||||||
if (!permissions.hasPermission('CONNECT')) {
|
if (!permissions.hasPermission('CONNECT')) {
|
||||||
throw new Error('You do not have permission to connect to this voice channel.');
|
throw new Error('You do not have permission to join this voice channel.');
|
||||||
}
|
}
|
||||||
|
|
||||||
options = mergeDefault({
|
options = mergeDefault({
|
||||||
|
|
@ -79,10 +79,7 @@ class ClientVoiceManager {
|
||||||
joinChannel(channel) {
|
joinChannel(channel) {
|
||||||
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.joinable) throw new Error('You do not have permission to join this voice channel.');
|
||||||
if (!channel.joinable) {
|
|
||||||
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) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue