diff --git a/src/MTProtoTools/UpdateHandler.php b/src/MTProtoTools/UpdateHandler.php index 3bc47fa3f..7d4e2c273 100644 --- a/src/MTProtoTools/UpdateHandler.php +++ b/src/MTProtoTools/UpdateHandler.php @@ -717,7 +717,7 @@ trait UpdateHandler $message['action']['message']['text'], MessageEntity::fromRawEntities($message['action']['message']['entities']), isset($message['action']['message']['parse_mode']) ? - ParseMode::fromString($message['action']['message']['parse_mode']) + ParseMode::from($message['action']['message']['parse_mode']) : null ) : null, $message['action']['convert_stars'], diff --git a/src/ParseMode.php b/src/ParseMode.php index 1391abf18..cd1dd39fd 100644 --- a/src/ParseMode.php +++ b/src/ParseMode.php @@ -24,14 +24,4 @@ enum ParseMode: string case HTML = 'HTML'; case MARKDOWN = 'Markdown'; case TEXT = 'text'; - /** @internal */ - public static function fromString(string $mode): ?string - { - foreach (self::cases() as $case) { - if(strtoupper($mode) === $case->name) { - return $case->value; - } - } - return null; - } -} +} \ No newline at end of file