fix: view channel required for joining. Closes #2009

This commit is contained in:
Skillz4Killz
2022-03-20 15:27:09 +00:00
committed by GitHub
parent a4ab58122b
commit 0769b442c1
2 changed files with 4 additions and 4 deletions
@@ -9,7 +9,7 @@ export default function connectToVoiceChannel(bot: BotWithCache) {
channelId,
options,
) {
const channel = await bot.channels.get(channelId);
const channel = bot.channels.get(channelId);
if (!channel) throw new Error("CHANNEL_NOT_FOUND");
if (
@@ -25,7 +25,7 @@ export default function connectToVoiceChannel(bot: BotWithCache) {
// Permissions needed for the bot to connect
// CONNECT is needed
const permsNeeded: PermissionStrings[] = ["CONNECT"];
const permsNeeded: PermissionStrings[] = ["CONNECT", "VIEW_CHANNEL"];
// Check if there is space for the bot if channel has user limit
// Having MANAGE_CHANNELS permissions bypasses the limit
@@ -38,7 +38,7 @@ export default function connectToVoiceChannel(bot: BotWithCache) {
permsNeeded.push("MANAGE_CHANNELS");
}
await requireBotChannelPermissions(bot, channel, permsNeeded);
requireBotChannelPermissions(bot, channel, permsNeeded);
return await connectToVoiceChannelOld(guildId, channelId, options);
};
+1 -1
View File
@@ -496,7 +496,7 @@ export enum BitwisePermissionFlags {
PRIORITY_SPEAKER = 0x0000000000000100,
/** Allows the user to go live */
STREAM = 0x0000000000000200,
/** Allows guild members to view a channel, which includes reading messages in text channels */
/** Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels */
VIEW_CHANNEL = 0x0000000000000400,
/** Allows for sending messages in a channel. (does not allow sending messages in threads) */
SEND_MESSAGES = 0x0000000000000800,