diff options
| author | Rapptz <[email protected]> | 2018-12-17 18:04:32 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2018-12-17 18:04:32 -0500 |
| commit | 648e62031df69222b08c284d03b0491f55b8e24a (patch) | |
| tree | 4cb882ef9f78f86cd95beee5ef1347bcfdba599e /discord/guild.py | |
| parent | Fix some lingering attribute setting issues. (diff) | |
| download | discord.py-648e62031df69222b08c284d03b0491f55b8e24a.tar.xz discord.py-648e62031df69222b08c284d03b0491f55b8e24a.zip | |
Add support for explicit_content_filter in Guild.edit
Diffstat (limited to 'discord/guild.py')
| -rw-r--r-- | discord/guild.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/discord/guild.py b/discord/guild.py index cf07697e..225a66e8 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -750,6 +750,8 @@ class Guild(Hashable): The new verification level for the guild. default_notifications: :class:`NotificationLevel` The new default notification level for the guild. + explicit_content_filter: :class:`ContentFilter` + The new explicit content filter for the guild. vanity_code: str The new vanity code for the guild. system_channel: Optional[:class:`TextChannel`] @@ -842,6 +844,11 @@ class Guild(Hashable): fields['verification_level'] = level.value + explicit_content_filter = fields.get('explicit_content_filter', self.explicit_content_filter) + if not isinstance(explicit_content_filter, ContentFilter): + raise InvalidArgument('explicit_content_filter field must of type ContentFilter') + + fields['explicit_content_filter'] = explicit_content_filter.value await http.edit_guild(self.id, reason=reason, **fields) async def get_ban(self, user): |