mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-03 14:04:51 +00:00
Make parse_mode always lowercase (#575)
* Make parse_mode always lowercase * Update client.py Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
This commit is contained in:
parent
b4bdab1047
commit
df4419da8f
1 changed files with 3 additions and 0 deletions
|
|
@ -397,6 +397,9 @@ class Client(Methods, Scaffold):
|
|||
|
||||
@parse_mode.setter
|
||||
def parse_mode(self, parse_mode: Optional[str] = "combined"):
|
||||
if isinstance(parse_mode, str):
|
||||
parse_mode = parse_mode.lower()
|
||||
|
||||
if parse_mode not in self.PARSE_MODES:
|
||||
raise ValueError('parse_mode must be one of {} or None. Not "{}"'.format(
|
||||
", ".join(f'"{m}"' for m in self.PARSE_MODES[:-1]),
|
||||
|
|
|
|||
Loading…
Reference in a new issue