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
@ -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 New Issue
Block a user