Skip to content

Commit

Permalink
fix NotificationLevel being suppressed
Browse files Browse the repository at this point in the history
  • Loading branch information
XuaTheGrate authored and Rapptz committed May 4, 2020
1 parent 6decfd1 commit 5107583
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -1050,12 +1050,10 @@ async def edit(self, *, reason=None, **fields):
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')
Expand Down

0 comments on commit 5107583

Please sign in to comment.