From 157d48eb8fe3ec8212ee21c76dbee38cdf8f34a1 Mon Sep 17 00:00:00 2001 From: Laith Youtuber <49840784+Laith98Dev@users.noreply.github.com> Date: Sun, 3 Sep 2023 01:56:22 +0300 Subject: [PATCH] Fix the logic error of `isThread()`. --- src/Plugin/Events/ChannelUpdated.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Plugin/Events/ChannelUpdated.php b/src/Plugin/Events/ChannelUpdated.php index 7f222aebf..53d770ff0 100644 --- a/src/Plugin/Events/ChannelUpdated.php +++ b/src/Plugin/Events/ChannelUpdated.php @@ -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; @@ -47,4 +47,4 @@ public function getChannel(): Channel{ public function getOldChannel(): ?Channel{ return $this->old_channel; } -} \ No newline at end of file +}