diff --git a/ntfy/backends/telegram.py b/ntfy/backends/telegram.py index 4b5a6ce..f2b9e86 100644 --- a/ntfy/backends/telegram.py +++ b/ntfy/backends/telegram.py @@ -8,11 +8,16 @@ config_file = path.join(config_dir, 'telegram.ini') -def notify(title, message, retcode=None): - """Sends message over Telegram using telegram-send, title is ignored.""" +def notify(title, message, parse_mode="text", retcode=None): + """ + Sends message over Telegram using telegram-send, title is ignored. + + Optional parameters: + * ``parse_mode`` - How telegram parses the text. Possible options are "text", "markdown" or "html". More details here: https://core.telegram.org/bots/api#formatting-options + """ if not path.exists(config_file): if not path.exists(config_dir): makedirs(config_dir) print("Follow the instructions to configure the Telegram backend.\n") configure(config_file) - send(messages=[message], conf=config_file) + send(messages=[message], parse_mode=parse_mode, conf=config_file)