From 4b30d72d2ccc1513b88bbd10b37e1331a157283e Mon Sep 17 00:00:00 2001 From: desimaniac <5501908+desimaniac@users.noreply.github.com> Date: Thu, 30 May 2019 23:27:52 -0500 Subject: [PATCH] Readme: added more details regarding notifications. --- README.md | 38 ++++++++++++++++++++++++++++++++------ notifications/slack.py | 2 +- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 480d74a..e4945ec 100644 --- a/README.md +++ b/README.md @@ -668,7 +668,10 @@ Notification alerts for Traktarr tasks. _Note: Manual commands need the `--notifications` flag._ -Currently, only Pushover and Slack are supported. More will be added later. +Currently, only Pushover and Slack are supported; others can be added in the future. + +_Note: The key name (i.e the name right under notifications) can be anything, but the `"service":` must be the exact service name (e.g. `"pushover"`)._ + ```json @@ -694,18 +697,41 @@ Currently, only Pushover and Slack are supported. More will be added later. ### Pushover -`app_token` and `user_token` - Retrieve from Pushover.net. +`app_token` - Retrieve from Pushover.net. Required. + +`user_token` - Retrieve from Pushover.net. Required. + +`priority` - Priority for the messages (see https://pushover.net/api#priority). Optional. -You can specify a priority for the messages send via Pushover using the `priority` key. It can be any Pushover priority value (https://pushover.net/api#priority). + - Choices are: `-2`, `-1`, `0`, `1`, `2`. -_Note: The key name (i.e the name right under notifications) can be anything, but the `"service":` must be exactly `"pushover"`._ + - Values are not quoted. + + - Default is `0`. ### Slack -`webhook_url` - Webhook URL you get after creating an "Incoming Webhook" under "Custom Integrations". +```json + "slack": { + "service": "slack", + "webhook_url": "", + "channel": "", + "sender_name": "Traktarr", + "sender_icon": ":movie_camera:" + }, + "verbose": true +}, +``` + +`webhook_url` - Webhook URL you get after creating an "Incoming Webhook" under "Custom Integrations" on Slack's Website. Required. + +`channel` - Slack channel. Optional. Default is none. + +`sender_name` - Name the sender of the message. Optional. Default is `Traktarr`. + +`sender_icon` - Icon to use for the message. Optional. Default is `:movie_camera:` -_Note: The key name (i.e the name right under notifications) can be anything, but the `"service":` must be exactly `"slack"`._ ## Radarr diff --git a/notifications/slack.py b/notifications/slack.py index 6c779fd..839a223 100644 --- a/notifications/slack.py +++ b/notifications/slack.py @@ -8,7 +8,7 @@ log = logger.get_logger(__name__) class Slack: NAME = "Slack" - def __init__(self, webhook_url, sender_name='traktarr', sender_icon=':movie_camera:', channel=None): + def __init__(self, webhook_url, sender_name='Traktarr', sender_icon=':movie_camera:', channel=None): self.webhook_url = webhook_url self.sender_name = sender_name self.sender_icon = sender_icon