1
0
Fork 0
mirror of synced 2024-05-19 20:12:30 +12:00

Use default or welcome notifications overrides

This commit is contained in:
Phxntxm 2017-06-17 18:03:54 -05:00
parent d5c49b2347
commit d1662e1a82

View file

@ -60,7 +60,12 @@ class StatsUpdate:
try:
join_leave_on = server_settings['join_leave']
if join_leave_on:
channel_id = server_settings.get('notifications_channel') or member.guild.id
# Get the notifications settings, get the welcome setting
notifications = self.bot.db.load('server_settings', key=guild.id, pluck='notifications') or {}
# Set our default to either the one set, or the default channel of the server
default_channel_id = notifications.get('default') or guild.id
# If it is has been overriden by picarto notifications setting, use this
channel_id = notifications.get('welcome') or default_channel_id
else:
return
except (IndexError, TypeError, KeyError):
@ -79,7 +84,12 @@ class StatsUpdate:
try:
join_leave_on = server_settings['join_leave']
if join_leave_on:
channel_id = server_settings.get('notifications_channel') or member.guild.id
# Get the notifications settings, get the welcome setting
notifications = self.bot.db.load('server_settings', key=guild.id, pluck='notifications') or {}
# Set our default to either the one set, or the default channel of the server
default_channel_id = notifications.get('default') or guild.id
# If it is has been overriden by picarto notifications setting, use this
channel_id = notifications.get('welcome') or default_channel_id
else:
return
except (IndexError, TypeError, KeyError):