mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix: view channel required for joining. Closes #2009
This commit is contained in:
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user