1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 03:34:42 +01:00
This commit is contained in:
AhJ 2023-12-31 23:05:02 +03:30
parent 44f3f81282
commit c3d967aa9c
2 changed files with 6 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -61,6 +61,7 @@ final class ChannelMessage extends Message
} catch (RPCErrorException $e) {
if ($e->rpc == 'MSG_ID_INVALID')
return null;
throw $e;
}
}