diff --git a/src/EventHandler/Filter/FilterTopicId.php b/src/EventHandler/Filter/FilterTopicId.php index 8c0acc34f..5acdb61e1 100644 --- a/src/EventHandler/Filter/FilterTopicId.php +++ b/src/EventHandler/Filter/FilterTopicId.php @@ -17,9 +17,10 @@ namespace danog\MadelineProto\EventHandler\Filter; use Attribute; -use danog\MadelineProto\EventHandler\Message; -use danog\MadelineProto\EventHandler\Update; use Webmozart\Assert\Assert; +use danog\MadelineProto\EventHandler\Update; +use danog\MadelineProto\EventHandler\Message; +use danog\MadelineProto\EventHandler\Typing\SupergroupUserTyping; /** * Allow only messages with a specific topic id (Supergroups only). @@ -34,6 +35,7 @@ final class FilterTopicId extends Filter } public function apply(Update $update): bool { - return ($update instanceof Message && $update->topicId === $this->topicId); + return ($update instanceof Message && $update->topicId === $this->topicId) || + ($update instanceof SupergroupUserTyping && $update->topicId === $this->topicId); } } diff --git a/src/EventHandler/Message/ChannelMessage.php b/src/EventHandler/Message/ChannelMessage.php index aa00da12b..6ae43f960 100644 --- a/src/EventHandler/Message/ChannelMessage.php +++ b/src/EventHandler/Message/ChannelMessage.php @@ -61,6 +61,7 @@ final class ChannelMessage extends Message } catch (RPCErrorException $e) { if ($e->rpc == 'MSG_ID_INVALID') return null; + throw $e; } }