From bbf62c7e462d7b779ac07a44f19896d6ede8a089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=8EAhJ?= Date: Fri, 13 Oct 2023 12:56:56 +0330 Subject: [PATCH] add new ChannelMessageViews update --- src/EventHandler/ChannelMessageViews.php | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/EventHandler/ChannelMessageViews.php 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']; + } +}