Skip to content

Commit

Permalink
Remove voice channel size assertion.
Browse files Browse the repository at this point in the history
- Closes #59
- Admins(TBC)/Owners can still join regardless of user limit.
  • Loading branch information
JaxkDev committed May 8, 2022
1 parent a8de8ca commit 19c2905
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion src/Models/Channels/VoiceChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class VoiceChannel extends ServerChannel{
/** @var int */
private $bitrate;

/** @var int The max amount of members that can join. */
/** @var int The max amount of members that can join - NOTE Admins(TBC)/Owner can still join if full. */
private $member_limit;

/** @var string[] Members in the channel (ID's only). */
Expand Down
4 changes: 0 additions & 4 deletions src/Plugin/BotCommunicationHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ private function handleVoiceStateUpdate(VoiceStateUpdatePacket $packet): void{
$member->setVoiceState($packet->getVoiceState());
Storage::updateMember($member);
}else{
if($channel->getMemberLimit() !== 0 and sizeof($channel->getMembers()) >= $channel->getMemberLimit()){
//Shouldn't ever happen.
throw new \AssertionError("Channel '{$state->getChannelId()}' shouldn't have room for this member.");
}
$previous = Storage::getMembersVoiceChannel($packet->getMemberId());
if($previous !== null and $previous->getId() !== $state->getChannelId()){
(new VoiceChannelMemberMovedEvent($this->plugin, $member, $previous, $channel, $state))->call();
Expand Down

0 comments on commit 19c2905

Please sign in to comment.