Skip to content

Commit

Permalink
Fix the logic error of isThread().
Browse files Browse the repository at this point in the history
  • Loading branch information
Laith98Dev committed Sep 2, 2023
1 parent c0ad5ac commit 157d48e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Plugin/Events/ChannelUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ final class ChannelUpdated extends DiscordBotEvent{

public function __construct(Plugin $plugin, Channel $channel, ?Channel $old_channel){
parent::__construct($plugin);
if(!$channel->getType()->isThread()){
if($channel->getType()->isThread()){
throw new \AssertionError("Channel cannot be a thread.");
}
if($old_channel !== null && !$old_channel->getType()->isThread()){
if($old_channel !== null && $old_channel->getType()->isThread()){
throw new \AssertionError("Old channel cannot be a thread.");
}
$this->channel = $channel;
Expand All @@ -47,4 +47,4 @@ public function getChannel(): Channel{
public function getOldChannel(): ?Channel{
return $this->old_channel;
}
}
}

0 comments on commit 157d48e

Please sign in to comment.