aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXua <[email protected]>2020-04-30 10:28:09 +1200
committerRapptz <[email protected]>2020-05-03 23:08:08 -0400
commit5107583c5db1eec6dc3a7300c0a1601913a1a9c2 (patch)
treef1b7939c71dc656572bac0d84194789da0216655
parentFix colour properties being displayed as methods in the documentation. (diff)
downloaddiscord.py-5107583c5db1eec6dc3a7300c0a1601913a1a9c2.tar.xz
discord.py-5107583c5db1eec6dc3a7300c0a1601913a1a9c2.zip
fix NotificationLevel being suppressed
-rw-r--r--discord/guild.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/discord/guild.py b/discord/guild.py
index 4ec93f68..b29b61ba 100644
--- a/discord/guild.py
+++ b/discord/guild.py
@@ -1050,12 +1050,10 @@ class Guild(Hashable):
fields['banner'] = banner
fields['splash'] = splash
- try:
- default_message_notifications = int(fields.pop('default_notifications'))
- except (TypeError, KeyError):
- pass
- else:
- fields['default_message_notifications'] = default_message_notifications
+ default_message_notifications = fields.get('default_notifications', self.default_notifications)
+ if not isinstance(default_message_notifications, NotificationLevel):
+ raise InvalidArgument('default_notifications field must be of type NotificationLevel')
+ fields['default_message_notifications'] = default_message_notifications.value
try:
afk_channel = fields.pop('afk_channel')