mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Fix diario text bug
This commit is contained in:
parent
7613e368dc
commit
11b119b08e
2 changed files with 8 additions and 6 deletions
|
@ -7,7 +7,10 @@ class SafeDict(dict):
|
|||
return key
|
||||
|
||||
|
||||
def safely_format_string(string: str, words: typing.Dict[str, str]) -> str:
|
||||
def safely_format_string(string: str, words: typing.Dict[str, str], ignore_escaping=False) -> str:
|
||||
if ignore_escaping:
|
||||
escaped = words
|
||||
else:
|
||||
escaped = {}
|
||||
for key in words:
|
||||
escaped[key] = words[key].replace("<", "<").replace(">", ">")
|
||||
|
|
|
@ -53,8 +53,7 @@ sentry = raven.Client(config["Sentry"]["token"],
|
|||
|
||||
|
||||
def reply_msg(bot: telegram.Bot, chat_id: int, string: str, ignore_escaping=False, **kwargs) -> telegram.Message:
|
||||
if not ignore_escaping:
|
||||
string = strings.safely_format_string(string, words=kwargs)
|
||||
string = strings.safely_format_string(string, ignore_escaping=ignore_escaping, words=kwargs)
|
||||
return bot.send_message(chat_id, string,
|
||||
parse_mode="HTML",
|
||||
disable_web_page_preview=True)
|
||||
|
|
Loading…
Reference in a new issue