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