1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-10 16:28:16 +01:00

Remove fromString as it doesn't needed

This commit is contained in:
Mahdi 2024-12-02 20:44:14 +03:30
parent cb950f139e
commit 54f7858494
2 changed files with 2 additions and 12 deletions

View File

@ -717,7 +717,7 @@ trait UpdateHandler
$message['action']['message']['text'], $message['action']['message']['text'],
MessageEntity::fromRawEntities($message['action']['message']['entities']), MessageEntity::fromRawEntities($message['action']['message']['entities']),
isset($message['action']['message']['parse_mode']) ? isset($message['action']['message']['parse_mode']) ?
ParseMode::fromString($message['action']['message']['parse_mode']) ParseMode::from($message['action']['message']['parse_mode'])
: null : null
) : null, ) : null,
$message['action']['convert_stars'], $message['action']['convert_stars'],

View File

@ -24,14 +24,4 @@ enum ParseMode: string
case HTML = 'HTML'; case HTML = 'HTML';
case MARKDOWN = 'Markdown'; case MARKDOWN = 'Markdown';
case TEXT = 'text'; 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;
}
}