. * * @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\Story; use danog\MadelineProto\EventHandler\Update; use danog\MadelineProto\MTProto; /** * Represents a reaction to a story. */ final class StoryReaction extends Update { /** @var int ID of the sender of the story */ public readonly int $senderId; /** @var int Story ID */ public readonly int $id; public readonly int|string|null $reaction; /** @internal */ public function __construct(MTProto $API, array $rawStory) { parent::__construct($API); $this->senderId = $API->getIdInternal($rawStory); $this->id = $rawStory['story_id']; $this->reaction = $rawStory['reaction']['emoticon'] ?? $rawStory['reaction']['document_id'] ?? null; } }