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

Add the ability to modify the Discord Bot Username. #8148

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions medusa/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ def initialize(self, console_logging=True):
check_setting_int(app.CFG, 'Discord', 'discord_notify_onsubtitledownload', 0))
app.DISCORD_WEBHOOK = check_setting_str(app.CFG, 'Discord', 'discord_webhook', '', censor_log='normal')
app.DISCORD_TTS = check_setting_bool(app.CFG, 'Discord', 'discord_tts', 0)
app.DISCORD_NAME = check_setting_str(app.CFG, 'Discord', 'discord_name', '', censor_log='normal')

app.USE_PROWL = bool(check_setting_int(app.CFG, 'Prowl', 'use_prowl', 0))
app.PROWL_NOTIFY_ONSNATCH = bool(check_setting_int(app.CFG, 'Prowl', 'prowl_notify_onsnatch', 0))
Expand Down Expand Up @@ -1765,6 +1766,7 @@ def save_config():
new_config['Discord']['discord_notify_onsubtitledownload'] = int(app.DISCORD_NOTIFY_ONSUBTITLEDOWNLOAD)
new_config['Discord']['discord_webhook'] = app.DISCORD_WEBHOOK
new_config['Discord']['discord_tts'] = int(app.DISCORD_TTS)
new_config['Discord']['discord_name'] = app.DISCORD_NAME

new_config['Prowl'] = {}
new_config['Prowl']['use_prowl'] = int(app.USE_PROWL)
Expand Down
2 changes: 2 additions & 0 deletions medusa/server/api/v2/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ class ConfigHandler(BaseRequestHandler):
'notifiers.discord.notifyOnSnatch': BooleanField(app, 'DISCORD_NOTIFY_ONSNATCH'),
'notifiers.discord.notifyOnDownload': BooleanField(app, 'DISCORD_NOTIFY_ONDOWNLOAD'),
'notifiers.discord.notifyOnSubtitleDownload': BooleanField(app, 'DISCORD_NOTIFY_ONSUBTITLEDOWNLOAD'),
'notifiers.discord.name': StringField(app, 'DISCORD_NAME'),

'notifiers.twitter.enabled': BooleanField(app, 'USE_TWITTER'),
'notifiers.twitter.dmto': StringField(app, 'TWITTER_DMTO'),
Expand Down Expand Up @@ -963,6 +964,7 @@ def data_notifiers():
section_data['discord']['notifyOnSubtitleDownload'] = bool(app.DISCORD_NOTIFY_ONSUBTITLEDOWNLOAD)
section_data['discord']['webhook'] = app.DISCORD_WEBHOOK
section_data['discord']['tts'] = bool(app.DISCORD_TTS)
section_data['discord']['name'] = app.DISCORD_NAME

section_data['twitter'] = {}
section_data['twitter']['enabled'] = bool(app.USE_TWITTER)
Expand Down
1 change: 1 addition & 0 deletions tests/apiv2/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ def config_notifiers():
section_data['discord']['notifyOnSubtitleDownload'] = bool(app.DISCORD_NOTIFY_ONSUBTITLEDOWNLOAD)
section_data['discord']['webhook'] = app.DISCORD_WEBHOOK
section_data['discord']['tts'] = bool(app.DISCORD_TTS)
section_data['discord']['name'] = app.DISCORD_NAME

section_data['twitter'] = {}
section_data['twitter']['enabled'] = bool(app.USE_TWITTER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@
<config-toggle-slider v-model="notifiers.discord.notifyOnSubtitleDownload" label="Notify on subtitle download" id="discord_notify_onsubtitledownload" :explanations="['send a message when subtitles are downloaded?']" @change="save()" />
<config-textbox v-model="notifiers.discord.webhook" label="Channel webhook" id="discord_webhook" :explanations="['Add a webhook to a channel, use the returned url here']" @change="save()" />
<config-toggle-slider v-model="notifiers.discord.tts" label="Text to speech" id="discord_tts" :explanations="['Use discord text to speech feature']" @change="save()" />
<config-textbox v-model="notifiers.discord.name" label="Bot username" id="discord_name" :explanations="['Create a username for the Discord Bot to use']" @change="save()" />

<div class="testNotification" id="testDiscord-result">Click below to test your settings.</div>
<input class="btn-medusa" type="button" value="Test Discord" id="testDiscord" @click="testDiscord">
Expand Down
4 changes: 2 additions & 2 deletions themes/dark/assets/js/medusa-runtime.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions themes/light/assets/js/medusa-runtime.js

Large diffs are not rendered by default.