Browse Source

Merge branch 'feature/ChangeDiscord' into develop

tags/release_0.25.1
JackDandy 5 years ago
parent
commit
7058f2aafa
  1. 3
      CHANGES.md
  2. 0
      gui/slick/images/notifiers/discord.png
  3. 60
      gui/slick/interfaces/default/config_notifications.tmpl
  4. 28
      gui/slick/js/configNotifications.js
  5. 62
      sickbeard/__init__.py
  6. 4
      sickbeard/notifiers/__init__.py
  7. 30
      sickbeard/notifiers/discord.py
  8. 30
      sickbeard/webserve.py

3
CHANGES.md

@ -1,5 +1,8 @@
### 0.23.0 (2019-xx-xx xx:xx:xx UTC)
* Change `Discordapp` to `Discord` in line with company change
* Change remove `app` from URL when calling webhook
* Change remind user when testing Notifications config / Discord to update URL
* Update attr 20.1.0.dev0 (4bd6827) to 20.2.0 (4f74fba)
* Update Beautiful Soup 4.8.2 (r559) to 4.9.1 (r585)
* Update dateutil 2.8.1 (43b7838) to 2.8.1 (c496b4f)

0
gui/slick/images/notifiers/discordapp.png → gui/slick/images/notifiers/discord.png

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

60
gui/slick/interfaces/default/config_notifications.tmpl

@ -1423,7 +1423,7 @@
<span class="list"><div class="item text">Bubble links:</div>
<div class="item"><a href="#trakt" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/trakt.png">Trakt</a></div>
<div class="item"><a href="#slack" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/slack.png">Slack</a></div>
<div class="item"><a href="#discordapp" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/discordapp.png">Discordapp</a></div>
<div class="item"><a href="#discord" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/discord.png">Discord</a></div>
<div class="item"><a href="#gitter" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/gitter.png">Gitter</a></div>
<div class="item"><a href="#telegram" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/telegram.png">Telegram</a></div>
<div class="item"><a href="#email" rel="noreferrer"><img height="16px" src="$sbRoot/images/notifiers/email.png">Email</a></div>
@ -1710,106 +1710,106 @@
<div class="component-group">
<div class="component-group-desc">
<img class="notifier-icon" src="$sbRoot/images/notifiers/discordapp.png" alt="" title="Discordapp">
<h3><a name="discordapp" href="<%= anon_url('https://discordapp.com/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Discordapp</a></h3>
<img class="notifier-icon" src="$sbRoot/images/notifiers/discord.png" alt="" title="Discord">
<h3><a name="discord" href="<%= anon_url('https://discord.com/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Discord</a></h3>
<p>Voice and text chat.</p>
</div>
<fieldset class="component-group-list">
<div class="field-pair">
<label for="use-discordapp">
<label for="use-discord">
<span class="component-title">Enable</span>
<span class="component-desc">
<input type="checkbox" class="enabler" name="use_discordapp" id="use-discordapp" #if $sickbeard.USE_DISCORDAPP then 'checked="checked"' else ''#>
<p>should SickGear send Discordapp notifications ?</p>
<input type="checkbox" class="enabler" name="use_discord" id="use-discord" #if $sickbeard.USE_DISCORD then 'checked="checked"' else ''#>
<p>should SickGear send Discord notifications ?</p>
</span>
</label>
</div>
<div id="content_use-discordapp">
<div id="content_use-discord">
<div class="field-pair">
<label for="discordapp-notify-onsnatch">
<label for="discord-notify-onsnatch">
<span class="component-title">Notify on snatch</span>
<span class="component-desc">
<input type="checkbox" name="discordapp_notify_onsnatch" id="discordapp-notify-onsnatch" #if $sickbeard.DISCORDAPP_NOTIFY_ONSNATCH then 'checked="checked"' else ''#>
<input type="checkbox" name="discord_notify_onsnatch" id="discord-notify-onsnatch" #if $sickbeard.DISCORD_NOTIFY_ONSNATCH then 'checked="checked"' else ''#>
<p>send a notification when a download starts ?</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="discordapp-notify-ondownload">
<label for="discord-notify-ondownload">
<span class="component-title">Notify on download</span>
<span class="component-desc">
<input type="checkbox" name="discordapp_notify_ondownload" id="discordapp-notify-ondownload" #if $sickbeard.DISCORDAPP_NOTIFY_ONDOWNLOAD then 'checked="checked"' else ''#>
<input type="checkbox" name="discord_notify_ondownload" id="discord-notify-ondownload" #if $sickbeard.DISCORD_NOTIFY_ONDOWNLOAD then 'checked="checked"' else ''#>
<p>send a notification when a download finishes ?</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="discordapp-notify-onsubtitledownload">
<label for="discord-notify-onsubtitledownload">
<span class="component-title">Notify on subtitle download</span>
<span class="component-desc">
<input type="checkbox" name="discordapp_notify_onsubtitledownload" id="discordapp-notify-onsubtitledownload" #if $sickbeard.DISCORDAPP_NOTIFY_ONSUBTITLEDOWNLOAD then 'checked="checked"' else ''#>
<input type="checkbox" name="discord_notify_onsubtitledownload" id="discord-notify-onsubtitledownload" #if $sickbeard.DISCORD_NOTIFY_ONSUBTITLEDOWNLOAD then 'checked="checked"' else ''#>
<p>send a notification when subtitles are downloaded ?</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="discordapp-as-authed">
<label for="discord-as-authed">
<span class="component-title">Post as authed user</span>
<span class="component-desc">
<input type="checkbox" class="view-if" name="discordapp_as_authed" id="discordapp-as-authed" #if $sickbeard.DISCORDAPP_AS_AUTHED then 'checked="checked"' else ''#>
<input type="checkbox" class="view-if" name="discord_as_authed" id="discord-as-authed" #if $sickbeard.DISCORD_AS_AUTHED then 'checked="checked"' else ''#>
<p>send notifications using the username and avatar of the channel webhook</p>
</span>
</label>
</div>
<div class="hide-if-discordapp-as-authed">
<div class="hide-if-discord-as-authed">
<div class="field-pair">
<label for="discordapp-username">
<label for="discord-username">
<span class="component-title">Post as a custom name</span>
<span class="component-desc">
<input type="text" name="discordapp_username" id="discordapp-username" value="$sickbeard.DISCORDAPP_USERNAME" class="form-control input-sm input250">
<input type="text" name="discord_username" id="discord-username" value="$sickbeard.DISCORD_USERNAME" class="form-control input-sm input250">
<p>blank for 'SickGear'</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="discordapp-icon-url">
<label for="discord-icon-url">
<span class="component-title">Custom icon image url</span>
<span class="component-desc">
<input type="text" name="discordapp_icon_url" id="discordapp-icon-url" value="$sickbeard.DISCORDAPP_ICON_URL" class="form-control input-sm input250">
<input type="text" name="discord_icon_url" id="discord-icon-url" value="$sickbeard.DISCORD_ICON_URL" class="form-control input-sm input250">
<p>blank for SickGear image</p>
</span>
</label>
</div>
</div>
<div class="field-pair">
<label for="discordapp-as-tts">
<label for="discord-as-tts">
<span class="component-title">Post as Text-To-Speech</span>
<span class="component-desc">
<input type="checkbox" name="discordapp_as_tts" id="discordapp-as-tts" #if $sickbeard.DISCORDAPP_AS_TTS then 'checked="checked"' else ''#>
<input type="checkbox" name="discord_as_tts" id="discord-as-tts" #if $sickbeard.DISCORD_AS_TTS then 'checked="checked"' else ''#>
<p>send notifications with Text-To-Speech enabled</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="discordapp-access-token">
<span class="component-title">Discordapp channel webhook</span>
<label for="discord-access-token">
<span class="component-title">Discord channel webhook</span>
<span class="component-desc">
<input type="text" name="discordapp_access_token" id="discordapp-access-token" value="$sickbeard.DISCORDAPP_ACCESS_TOKEN" class="form-control input-sm input350">
<input type="text" name="discord_access_token" id="discord-access-token" value="$sickbeard.DISCORD_ACCESS_TOKEN" class="form-control input-sm input350">
<div class="clear-left"><p>1. 'Edit Channel' for the server where you have permission<br>
2. select the 'Webhooks' menu item then 'Create Webhook'<br>
3. copy the webook url, paste it to the above field<br>
4. select 'Save' in Discordapp</p></div>
4. select 'Save' in Discord</p></div>
</span>
</label>
</div>
<div class="test-notification" id="test-discordapp-result">Click below to test</div>
<input type="button" class="btn" value="Test Discordapp" id="test-discordapp">
<div class="test-notification" id="test-discord-result">Click below to test</div>
<input type="button" class="btn" value="Test Discord" id="test-discord">
<input type="submit" class="btn config_submitter" value="Save Changes">
</div><!-- /content_use-discordapp //-->
</div><!-- /content_use-discord //-->
</fieldset>
</div><!-- /discordapp component-group //-->
</div><!-- /discord component-group //-->
<div class="component-group">

28
gui/slick/js/configNotifications.js

@ -465,26 +465,26 @@ $(document).ready(function(){
}
});
$('#test-discordapp').click(function () {
var discordappAsAuthed = $('#discordapp-as-authed').prop('checked'),
discordappUsername = $('#discordapp-username').val(), discordappIconUrl = $('#discordapp-icon-url').val(),
discordappAsTts = $('#discordapp-as-tts').prop('checked'),
accessToken = '#discordapp-access-token', discordappAccessToken = $(accessToken).val();
$('#test-discord').click(function () {
var discordAsAuthed = $('#discord-as-authed').prop('checked'),
discordUsername = $('#discord-username').val(), discordIconUrl = $('#discord-icon-url').val(),
discordAsTts = $('#discord-as-tts').prop('checked'),
accessToken = '#discord-access-token', discordAccessToken = $(accessToken).val();
$(accessToken).removeClass('warning');
if (!discordappAccessToken) {
$('#test-discordapp-result').html('Please fill out the necessary fields above.');
if (!discordappAccessToken)
if (!discordAccessToken) {
$('#test-discord-result').html('Please fill out the necessary fields above.');
if (!discordAccessToken)
$(accessToken).addClass('warning');
} else {
$(this).prop('disabled', !0);
$('#test-discordapp-result').html(loading);
$.get(sbRoot + '/home/test-discordapp',
{as_authed: discordappAsAuthed, username: discordappUsername, icon_url: discordappIconUrl,
as_tts: discordappAsTts, access_token: discordappAccessToken})
$('#test-discord-result').html(loading);
$.get(sbRoot + '/home/test-discord',
{as_authed: discordAsAuthed, username: discordUsername, icon_url: discordIconUrl,
as_tts: discordAsTts, access_token: discordAccessToken})
.done(function (data) {
$('#test-discordapp-result').html(data);
$('#test-discordapp').prop('disabled', !1);
$('#test-discord-result').html(data);
$('#test-discord').prop('disabled', !1);
});
}
});

62
sickbeard/__init__.py

@ -449,15 +449,15 @@ SLACK_BOT_NAME = None
SLACK_ICON_URL = None
SLACK_ACCESS_TOKEN = None
USE_DISCORDAPP = False
DISCORDAPP_NOTIFY_ONSNATCH = False
DISCORDAPP_NOTIFY_ONDOWNLOAD = False
DISCORDAPP_NOTIFY_ONSUBTITLEDOWNLOAD = False
DISCORDAPP_AS_AUTHED = False
DISCORDAPP_USERNAME = None
DISCORDAPP_ICON_URL = None
DISCORDAPP_AS_TTS = 0
DISCORDAPP_ACCESS_TOKEN = None
USE_DISCORD = False
DISCORD_NOTIFY_ONSNATCH = False
DISCORD_NOTIFY_ONDOWNLOAD = False
DISCORD_NOTIFY_ONSUBTITLEDOWNLOAD = False
DISCORD_AS_AUTHED = False
DISCORD_USERNAME = None
DISCORD_ICON_URL = None
DISCORD_AS_TTS = 0
DISCORD_ACCESS_TOKEN = None
USE_GITTER = False
GITTER_NOTIFY_ONSNATCH = False
@ -731,9 +731,9 @@ def init_stage_1(console_logging):
MC_MRU, TVC_MRU, \
USE_SLACK, SLACK_NOTIFY_ONSNATCH, SLACK_NOTIFY_ONDOWNLOAD, SLACK_NOTIFY_ONSUBTITLEDOWNLOAD, \
SLACK_CHANNEL, SLACK_AS_AUTHED, SLACK_BOT_NAME, SLACK_ICON_URL, SLACK_ACCESS_TOKEN, \
USE_DISCORDAPP, DISCORDAPP_NOTIFY_ONSNATCH, DISCORDAPP_NOTIFY_ONDOWNLOAD, \
DISCORDAPP_NOTIFY_ONSUBTITLEDOWNLOAD, \
DISCORDAPP_AS_AUTHED, DISCORDAPP_USERNAME, DISCORDAPP_ICON_URL, DISCORDAPP_AS_TTS, DISCORDAPP_ACCESS_TOKEN,\
USE_DISCORD, DISCORD_NOTIFY_ONSNATCH, DISCORD_NOTIFY_ONDOWNLOAD, \
DISCORD_NOTIFY_ONSUBTITLEDOWNLOAD, \
DISCORD_AS_AUTHED, DISCORD_USERNAME, DISCORD_ICON_URL, DISCORD_AS_TTS, DISCORD_ACCESS_TOKEN,\
USE_GITTER, GITTER_NOTIFY_ONSNATCH, GITTER_NOTIFY_ONDOWNLOAD, GITTER_NOTIFY_ONSUBTITLEDOWNLOAD,\
GITTER_ROOM, GITTER_ACCESS_TOKEN, \
USE_TELEGRAM, TELEGRAM_NOTIFY_ONSNATCH, TELEGRAM_NOTIFY_ONDOWNLOAD, TELEGRAM_NOTIFY_ONSUBTITLEDOWNLOAD, \
@ -744,7 +744,7 @@ def init_stage_1(console_logging):
global ANIME_TREAT_AS_HDTV, USE_ANIDB, ANIDB_USERNAME, ANIDB_PASSWORD, ANIDB_USE_MYLIST
for stanza in ('General', 'Blackhole', 'SABnzbd', 'NZBGet', 'Emby', 'Kodi', 'XBMC', 'PLEX',
'Growl', 'Prowl', 'Slack', 'Discordapp', 'Boxcar2', 'NMJ', 'NMJv2',
'Growl', 'Prowl', 'Slack', 'Discord', 'Boxcar2', 'NMJ', 'NMJv2',
'Synology', 'SynologyNotifier',
'pyTivo', 'Pushalot', 'Pushbullet', 'Subtitles'):
check_section(CFG, stanza)
@ -1179,16 +1179,16 @@ def init_stage_1(console_logging):
SLACK_ICON_URL = check_setting_str(CFG, 'Slack', 'slack_icon_url', '')
SLACK_ACCESS_TOKEN = check_setting_str(CFG, 'Slack', 'slack_access_token', '')
USE_DISCORDAPP = bool(check_setting_int(CFG, 'Discordapp', 'use_discordapp', 0))
DISCORDAPP_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Discordapp', 'discordapp_notify_onsnatch', 0))
DISCORDAPP_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Discordapp', 'discordapp_notify_ondownload', 0))
DISCORDAPP_NOTIFY_ONSUBTITLEDOWNLOAD = bool(
check_setting_int(CFG, 'Discordapp', 'discordapp_notify_onsubtitledownload', 0))
DISCORDAPP_AS_AUTHED = bool(check_setting_int(CFG, 'Discordapp', 'discordapp_as_authed', 0))
DISCORDAPP_USERNAME = check_setting_str(CFG, 'Discordapp', 'discordapp_username', '')
DISCORDAPP_ICON_URL = check_setting_str(CFG, 'Discordapp', 'discordapp_icon_url', '')
DISCORDAPP_AS_TTS = bool(check_setting_str(CFG, 'Discordapp', 'discordapp_as_tts', 0))
DISCORDAPP_ACCESS_TOKEN = check_setting_str(CFG, 'Discordapp', 'discordapp_access_token', '')
USE_DISCORD = bool(check_setting_int(CFG, 'Discord', 'use_discord', 0))
DISCORD_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Discord', 'discord_notify_onsnatch', 0))
DISCORD_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Discord', 'discord_notify_ondownload', 0))
DISCORD_NOTIFY_ONSUBTITLEDOWNLOAD = bool(
check_setting_int(CFG, 'Discord', 'discord_notify_onsubtitledownload', 0))
DISCORD_AS_AUTHED = bool(check_setting_int(CFG, 'Discord', 'discord_as_authed', 0))
DISCORD_USERNAME = check_setting_str(CFG, 'Discord', 'discord_username', '')
DISCORD_ICON_URL = check_setting_str(CFG, 'Discord', 'discord_icon_url', '')
DISCORD_AS_TTS = bool(check_setting_str(CFG, 'Discord', 'discord_as_tts', 0))
DISCORD_ACCESS_TOKEN = check_setting_str(CFG, 'Discord', 'discord_access_token', '')
USE_GITTER = bool(check_setting_int(CFG, 'Gitter', 'use_gitter', 0))
GITTER_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Gitter', 'gitter_notify_onsnatch', 0))
@ -2100,13 +2100,13 @@ def save_config():
('icon_url', SLACK_ICON_URL),
('access_token', SLACK_ACCESS_TOKEN),
]),
('Discordapp', [
('use_%s', int(USE_DISCORDAPP)),
('as_authed', int(DISCORDAPP_AS_AUTHED)),
('username', DISCORDAPP_USERNAME),
('icon_url', DISCORDAPP_ICON_URL),
('as_tts', int(DISCORDAPP_AS_TTS)),
('access_token', DISCORDAPP_ACCESS_TOKEN),
('Discord', [
('use_%s', int(USE_DISCORD)),
('as_authed', int(DISCORD_AS_AUTHED)),
('username', DISCORD_USERNAME),
('icon_url', DISCORD_ICON_URL),
('as_tts', int(DISCORD_AS_TTS)),
('access_token', DISCORD_ACCESS_TOKEN),
]),
('Gitter', [
('use_%s', int(USE_GITTER)),
@ -2160,7 +2160,7 @@ def save_config():
# ('Pushalot', PUSHALOT_NOTIFY_ONSNATCH, PUSHALOT_NOTIFY_ONDOWNLOAD, PUSHALOT_NOTIFY_ONSUBTITLEDOWNLOAD),
('Slack', SLACK_NOTIFY_ONSNATCH, SLACK_NOTIFY_ONDOWNLOAD, SLACK_NOTIFY_ONSUBTITLEDOWNLOAD),
('Discordapp', DISCORDAPP_NOTIFY_ONSNATCH, DISCORDAPP_NOTIFY_ONDOWNLOAD, DISCORDAPP_NOTIFY_ONSUBTITLEDOWNLOAD),
('Discord', DISCORD_NOTIFY_ONSNATCH, DISCORD_NOTIFY_ONDOWNLOAD, DISCORD_NOTIFY_ONSUBTITLEDOWNLOAD),
('Gitter', GITTER_NOTIFY_ONSNATCH, GITTER_NOTIFY_ONDOWNLOAD, GITTER_NOTIFY_ONSUBTITLEDOWNLOAD),
('Telegram', TELEGRAM_NOTIFY_ONSNATCH, TELEGRAM_NOTIFY_ONDOWNLOAD, TELEGRAM_NOTIFY_ONSUBTITLEDOWNLOAD),
('Email', EMAIL_NOTIFY_ONSNATCH, EMAIL_NOTIFY_ONDOWNLOAD, EMAIL_NOTIFY_ONSUBTITLEDOWNLOAD),

4
sickbeard/notifiers/__init__.py

@ -23,7 +23,7 @@ import re
# from lib import libtrakt
from . import emby, kodi, plex, xbmc, \
boxcar2, nmj, nmjv2, pushbullet, pushover, pytivo, synoindex, synologynotifier, \
discordapp, emailnotify, gitter, libnotify, growl, prowl, slack, telegram, trakt
discord, emailnotify, gitter, libnotify, growl, prowl, slack, telegram, trakt
import sickbeard
# noinspection PyPep8Naming
@ -59,7 +59,7 @@ class NotifierFactory(object):
# social
TRAKT=trakt.TraktNotifier,
SLACK=slack.SlackNotifier,
DISCORDAPP=discordapp.DiscordappNotifier,
DISCORD=discord.DiscordNotifier,
GITTER=gitter.GitterNotifier,
TELEGRAM=telegram.TelegramNotifier,
EMAIL=emailnotify.EmailNotifier,

30
sickbeard/notifiers/discordapp.py → sickbeard/notifiers/discord.py

@ -17,31 +17,41 @@
# You should have received a copy of the GNU General Public License
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
import re
from .generic import Notifier
import sickbeard
class DiscordappNotifier(Notifier):
class DiscordNotifier(Notifier):
def __init__(self):
super(DiscordappNotifier, self).__init__()
super(DiscordNotifier, self).__init__()
def _notify(self, title, body, as_authed=None, username='', icon_url='', as_tts='', access_token='', **kwargs):
params = [] if not bool(self._choose(not as_authed, sickbeard.DISCORDAPP_AS_AUTHED)) else \
[('username', self._choose(username, sickbeard.DISCORDAPP_USERNAME) or 'SickGear'),
('avatar_url', self._choose(icon_url, sickbeard.DISCORDAPP_ICON_URL) or self._sg_logo_url)]
as_tts = self._choose(as_tts, bool(sickbeard.DISCORDAPP_AS_TTS))
params = [] if not bool(self._choose(not as_authed, sickbeard.DISCORD_AS_AUTHED)) else \
[('username', self._choose(username, sickbeard.DISCORD_USERNAME) or 'SickGear'),
('avatar_url', self._choose(icon_url, sickbeard.DISCORD_ICON_URL) or self._sg_logo_url)]
as_tts = self._choose(as_tts, bool(sickbeard.DISCORD_AS_TTS))
url = self._choose(access_token, sickbeard.DISCORD_ACCESS_TOKEN)
success_and_deprecated_msg = ''
if 'discordapp' in url:
# upgrade webhook url for get_url, and notify user on test to update setting
url = re.sub(r'^(https?://discord)app', r'\1', url)
success_and_deprecated_msg = '<br><br>Note2: Please change `discordapp.com` ' \
'in Discord channel webhook to `discord.com`'
resp = sickbeard.helpers.get_url(
url=self._choose(access_token, sickbeard.DISCORDAPP_ACCESS_TOKEN),
url=url,
post_json=dict([('content', self._body_only(title, body)), ('tts', as_tts)] + params))
result = '' == resp or self._choose('bad webhook?', None)
if True is not result:
self._log_error('%s failed to send message: %s' % (self.name, result))
return self._choose(('Success, notification sent. (Note: %s clients display icon once in a sequence)'
% self.name, 'Failed to send notification, %s' % result)[True is not result], result)
return self._choose(('Success, notification sent. (Note: %s displays the icon once in a sequence)%s'
% (self.name, success_and_deprecated_msg),
'Failed to send notification, %s' % result)[True is not result], result)
notifier = DiscordappNotifier
notifier = DiscordNotifier

30
sickbeard/webserve.py

@ -1774,10 +1774,10 @@ class Home(MainHandler):
channel=channel, as_authed='true' == as_authed,
bot_name=bot_name, icon_url=icon_url, access_token=access_token)
def test_discordapp(self, as_authed=False, username=None, icon_url=None, as_tts=False, access_token=None):
def test_discord(self, as_authed=False, username=None, icon_url=None, as_tts=False, access_token=None):
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
return notifiers.NotifierFactory().get('DISCORDAPP').test_notify(
return notifiers.NotifierFactory().get('DISCORD').test_notify(
as_authed='true' == as_authed, username=username, icon_url=icon_url,
as_tts='true' == as_tts, access_token=access_token)
@ -7820,10 +7820,10 @@ class ConfigNotifications(Config):
use_slack=None, slack_notify_onsnatch=None, slack_notify_ondownload=None,
slack_notify_onsubtitledownload=None, slack_access_token=None, slack_channel=None,
slack_as_authed=None, slack_bot_name=None, slack_icon_url=None,
use_discordapp=None, discordapp_notify_onsnatch=None, discordapp_notify_ondownload=None,
discordapp_notify_onsubtitledownload=None, discordapp_access_token=None,
discordapp_as_authed=None, discordapp_username=None, discordapp_icon_url=None,
discordapp_as_tts=None,
use_discord=None, discord_notify_onsnatch=None, discord_notify_ondownload=None,
discord_notify_onsubtitledownload=None, discord_access_token=None,
discord_as_authed=None, discord_username=None, discord_icon_url=None,
discord_as_tts=None,
use_gitter=None, gitter_notify_onsnatch=None, gitter_notify_ondownload=None,
gitter_notify_onsubtitledownload=None, gitter_access_token=None, gitter_room=None,
use_telegram=None, telegram_notify_onsnatch=None, telegram_notify_ondownload=None,
@ -7967,15 +7967,15 @@ class ConfigNotifications(Config):
sickbeard.SLACK_BOT_NAME = slack_bot_name
sickbeard.SLACK_ICON_URL = slack_icon_url
sickbeard.USE_DISCORDAPP = config.checkbox_to_value(use_discordapp)
sickbeard.DISCORDAPP_NOTIFY_ONSNATCH = config.checkbox_to_value(discordapp_notify_onsnatch)
sickbeard.DISCORDAPP_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(discordapp_notify_ondownload)
sickbeard.DISCORDAPP_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(discordapp_notify_onsubtitledownload)
sickbeard.DISCORDAPP_ACCESS_TOKEN = discordapp_access_token
sickbeard.DISCORDAPP_AS_AUTHED = config.checkbox_to_value(discordapp_as_authed)
sickbeard.DISCORDAPP_USERNAME = discordapp_username
sickbeard.DISCORDAPP_ICON_URL = discordapp_icon_url
sickbeard.DISCORDAPP_AS_TTS = config.checkbox_to_value(discordapp_as_tts)
sickbeard.USE_DISCORD = config.checkbox_to_value(use_discord)
sickbeard.DISCORD_NOTIFY_ONSNATCH = config.checkbox_to_value(discord_notify_onsnatch)
sickbeard.DISCORD_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(discord_notify_ondownload)
sickbeard.DISCORD_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(discord_notify_onsubtitledownload)
sickbeard.DISCORD_ACCESS_TOKEN = discord_access_token
sickbeard.DISCORD_AS_AUTHED = config.checkbox_to_value(discord_as_authed)
sickbeard.DISCORD_USERNAME = discord_username
sickbeard.DISCORD_ICON_URL = discord_icon_url
sickbeard.DISCORD_AS_TTS = config.checkbox_to_value(discord_as_tts)
sickbeard.USE_GITTER = config.checkbox_to_value(use_gitter)
sickbeard.GITTER_NOTIFY_ONSNATCH = config.checkbox_to_value(gitter_notify_onsnatch)

Loading…
Cancel
Save