diff --git a/src/Messages/NoticeMessage.php b/src/Messages/NoticeMessage.php index fee4f22..11e9289 100644 --- a/src/Messages/NoticeMessage.php +++ b/src/Messages/NoticeMessage.php @@ -37,10 +37,11 @@ public function __construct(string $message) public function handle(Client $client, array $channels): array { - if (array_key_exists($this->commandSuffix, $channels)) { - $this->channel = $channels[$this->commandSuffix]; + if (!array_key_exists($this->commandSuffix, $channels)) { + return []; } + $this->channel = $channels[$this->commandSuffix]; $msgId = $this->tags['msg-id'] ?? ''; $events = [ new NoticeEvent($this->channel, $msgId),