diff --git a/src/EventHandler/ChannelMessageViews.php b/src/EventHandler/ChannelMessageViews.php new file mode 100644 index 000000000..be8302b35 --- /dev/null +++ b/src/EventHandler/ChannelMessageViews.php @@ -0,0 +1,44 @@ +. + * + * @author Amir Hossein Jafari + * @copyright 2016-2023 Amir Hossein Jafari + * @license https://opensource.org/licenses/AGPL-3.0 AGPLv3 + * @link https://docs.madelineproto.xyz MadelineProto documentation + */ + +namespace danog\MadelineProto\EventHandler; + +use danog\MadelineProto\MTProto; +use danog\MadelineProto\MTProtoTools\DialogId; + +/** + * Represents the view counter of a message in a channel has changed. + */ +final class ChannelMessageViews extends Update +{ + /** Channel ID */ + public readonly int $chatId; + + /** ID of the message */ + public readonly int $id; + + /** New view counter */ + public readonly int $views; + + /** @internal */ + public function __construct(MTProto $API, array $rawDelete) + { + parent::__construct($API); + $this->chatId = DialogId::fromSupergroupOrChannel($rawDelete['channel_id']); + $this->id = $rawDelete['id']; + $this->views = $rawDelete['views']; + } +}