Add support for default notification level in audit logs and Guild.edit

This commit is contained in:
Rapptz
2018-11-25 01:42:33 -05:00
parent c30b016bb5
commit 8b18fa307b
5 changed files with 40 additions and 21 deletions

View File

@ -748,6 +748,8 @@ class Guild(Hashable):
be owner of the guild to do this.
verification_level: :class:`VerificationLevel`
The new verification level for the guild.
default_notifications: :class:`NotificationLevel`
The new default notification level for the guild.
vanity_code: str
The new vanity code for the guild.
system_channel: Optional[:class:`TextChannel`]
@ -798,6 +800,13 @@ class Guild(Hashable):
fields['icon'] = icon
fields['splash'] = splash
try:
default_message_notifications = int(fields.pop('default_notifications'))
except (TypeError, KeyError):
pass
else:
fields['default_message_notifications'] = default_message_notifications
try:
afk_channel = fields.pop('afk_channel')
except KeyError: