feat(Browser): remove browser � (#5113)

This commit is contained in:
Noel
2020-12-14 13:56:16 +01:00
committed by GitHub
parent 5c4547e84d
commit 0a591a9697
22 changed files with 895 additions and 3735 deletions

View File

@@ -1,9 +1,7 @@
'use strict';
const GuildChannel = require('./GuildChannel');
const { Error } = require('../errors');
const Collection = require('../util/Collection');
const { browser } = require('../util/Constants');
const Permissions = require('../util/Permissions');
/**
@@ -74,7 +72,6 @@ class VoiceChannel extends GuildChannel {
* @readonly
*/
get joinable() {
if (browser) return false;
if (!this.viewable) return false;
if (!this.permissionsFor(this.client.user).has(Permissions.FLAGS.CONNECT, false)) return false;
if (this.full && !this.permissionsFor(this.client.user).has(Permissions.FLAGS.MOVE_MEMBERS, false)) return false;
@@ -130,7 +127,6 @@ class VoiceChannel extends GuildChannel {
* .catch(console.error);
*/
join() {
if (browser) return Promise.reject(new Error('VOICE_NO_BROWSER'));
return this.client.voice.joinChannel(this);
}
@@ -141,7 +137,6 @@ class VoiceChannel extends GuildChannel {
* voiceChannel.leave();
*/
leave() {
if (browser) return;
const connection = this.client.voice.connections.get(this.guild.id);
if (connection && connection.channel.id === this.id) connection.disconnect();
}