Skip to content

Commit

Permalink
fix: voice knock always increasing limit after the duration (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
geisterfurz007 authored Jun 1, 2023
1 parent 105bf04 commit 0754a58
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/programs/voice-on-demand/commands/voice-knock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ class VoiceKnock extends CommandHandler<DiscordEvent.SLASH_COMMAND> {
: `Sorry, but the room owner didn't respond.`
);

const newLimit = Math.min(
maxMembers,
Math.max(channel.members.size, channel.userLimit) + 1
);
await channel.setUserLimit(newLimit);
if (gotAccess) {
const newLimit = Math.min(
maxMembers,
Math.max(channel.members.size, channel.userLimit) + 1
);
await channel.setUserLimit(newLimit);
}
}

private async requestAccess(
Expand Down

0 comments on commit 0754a58

Please sign in to comment.