. * * @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; /** * A user is typing. */ final class AbstractTyping extends Update { /** @var int The user id that is typing. */ public readonly int $userId; /** @var AbstractAction Whether the user is typing, sending a media or doing something else. */ public readonly AbstractAction $action; /** @internal */ public function __construct(MTProto $API, array $rawTyping) { parent::__construct($API); $this->userId = $rawTyping['user_id'] ?? $API->getIdInternal($rawTyping['from_id']); $this->action = AbstractAction::fromRawAction($rawTyping['action']); } }