Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Telegram MarkdownV2 parse_mode #442

Open
kva1966 opened this issue Jul 5, 2022 · 0 comments
Open

Support Telegram MarkdownV2 parse_mode #442

kva1966 opened this issue Jul 5, 2022 · 0 comments
Milestone

Comments

@kva1966
Copy link

kva1966 commented Jul 5, 2022

This is related to the Telegram provider's notify(... parse_mode='html'|'markdown') parameter, defined as:

  parse_mode:
    enum:
    - markdown
    - html
    title: Send Markdown or HTML, if you want Telegram apps to show bold, italic,
      fixed-width text or inline URLs in your bot's message.
    type: string

in https://notifiers.readthedocs.io/en/latest/providers/telegram.html

markdown is now considered legacy, and superseded by MarkdownV2, see: https://core.telegram.org/bots/api#markdownv2-style

The following code:

    telegram = get_notifier('telegram')
    telegram.notify(
        token='<token>',
        chat_id='<chat id>',
        parse_mode='MarkdownV2',
        raise_on_errors=True,
        message='Foo',

Results in:

notifiers.exceptions.BadArguments: Error with sent data: 'MarkdownV2' is not one of ['markdown', 'html']

Happy to take a look and create a PR. Guidance welcome, too.

Thanks for the awesomely useful project.

@liiight liiight added this to the 1.3.4 milestone Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants