Modificada función de escape

This commit is contained in:
Joan Cano
2023-03-02 12:04:27 +01:00
parent f21bb4d65c
commit d07b80960b

View File

@@ -3,5 +3,8 @@ TELEGRAM_ESCAPE_CHARACTERS = ['_', '*', '[', ']', '(', ')', '~', '>', '#', '+',
def telegram_escape_characters(text):
for character in TELEGRAM_ESCAPE_CHARACTERS:
text = text.replace(character, f'\{character}')
try:
text = text.replace(character, f'\{character}')
except:
pass
return text