Skip to content

v0.6.4

Compare
Choose a tag to compare
@liiight liiight released this 18 Jan 10:52
· 276 commits to main since this release
  • Major refactor, reintroduced provider resources:
>>> from notifiers import get_notifier
>>> telegram = get_notifier('telegram')
>>> telegram.resources
['updates']
>>> telegram.updates
<ProviderResource,provider=telegram,resource=updates>
>>> telegram.updates()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Users/orcarmi/PycharmProjects/notifiers/notifiers/core.py", line 278, in __call__
    data = self._process_data(**kwargs)
  File "/Users/orcarmi/PycharmProjects/notifiers/notifiers/core.py", line 204, in _process_data
    self._validate_data(data, validator)
  File "/Users/orcarmi/PycharmProjects/notifiers/notifiers/core.py", line 175, in _validate_data
    raise BadArguments(validation_error=msg, provider=self.name, data=data)
notifiers.exceptions.BadArguments: Error with sent data: 'token' is a required property
>>> telegram.updates(token='foo')
  • Major CLI refactor, validates command options via type (as opposed to keyword=value as it was, which was always string. Yuck)
$ notifiers --help
Usage: notifiers [OPTIONS] COMMAND [ARGS]...

  Notifiers CLI operation

Options:
  --version          Show the version and exit.
  --env-prefix TEXT  Set a custom prefix for env vars usage
  --help             Show this message and exit.

Commands:
  email       Options for 'email'
  gitter      Options for 'gitter'
  gmail       Options for 'gmail'
  hipchat     Options for 'hipchat'
  join        Options for 'join'
  providers   Shows all available providers
  pushbullet  Options for 'pushbullet'
  pushover    Options for 'pushover'
  simplepush  Options for 'simplepush'
  slack       Options for 'slack'
  telegram    Options for 'telegram'
  zulip       Options for 'zulip'
$ notifiers telegram notify --help
Usage: notifiers telegram notify [OPTIONS] [MESSAGE]

  Send Telegram notifications

Options:
  --token TEXT                    Bot token
  --chat-id TEXT
  --parse-mode [markdown|html]    Send markdown or html, if you want telegram
                                  apps to show bold, italic, fixed-width text
                                  or inline urls in your bot's message.
  --disable-web-page-preview / --no-disable-web-page-preview
                                  Disables link previews for links in this
                                  message
  --disable-notification / --no-disable-notification
                                  Sends the message silently. users will
                                  receive a notification with no sound.
  --reply-to-message-id INTEGER   If the message is a reply, id of the
                                  original message
  --help                          Show this message and exit.

See docs for details.