aboutsummaryrefslogtreecommitdiff
path: root/discord/guild.py
diff options
context:
space:
mode:
authorRobin <[email protected]>2021-04-14 06:48:51 +0200
committerGitHub <[email protected]>2021-04-14 00:48:51 -0400
commit30310b9ab69e443d0f2da3334c067383a2827f87 (patch)
tree71bafb22a23b6332b5712ed794e8ae73f929ddec /discord/guild.py
parentRemove support for guild subscriptions (diff)
downloaddiscord.py-30310b9ab69e443d0f2da3334c067383a2827f87.tar.xz
discord.py-30310b9ab69e443d0f2da3334c067383a2827f87.zip
Add NSFW for Guilds
Diffstat (limited to 'discord/guild.py')
-rw-r--r--discord/guild.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/discord/guild.py b/discord/guild.py
index f8d837be..d6664514 100644
--- a/discord/guild.py
+++ b/discord/guild.py
@@ -168,6 +168,11 @@ class Guild(Hashable):
The guild's discovery splash.
.. versionadded:: 1.3
+
+ nsfw: :class:`bool`
+ If the guild is marked as "not safe for work".
+
+ .. versionadded:: 2.0
"""
__slots__ = ('afk_timeout', 'afk_channel', '_members', '_channels', 'icon',
@@ -179,7 +184,7 @@ class Guild(Hashable):
'description', 'max_presences', 'max_members', 'max_video_channel_users',
'premium_tier', 'premium_subscription_count', '_system_channel_flags',
'preferred_locale', 'discovery_splash', '_rules_channel_id',
- '_public_updates_channel_id')
+ '_public_updates_channel_id', 'nsfw')
_PREMIUM_GUILD_LIMITS = {
None: _GuildLimit(emoji=50, bitrate=96e3, filesize=8388608),
@@ -314,6 +319,7 @@ class Guild(Hashable):
self.discovery_splash = guild.get('discovery_splash')
self._rules_channel_id = utils._get_as_snowflake(guild, 'rules_channel_id')
self._public_updates_channel_id = utils._get_as_snowflake(guild, 'public_updates_channel_id')
+ self.nsfw = guild.get('nsfw', False)
cache_joined = self._state.member_cache_flags.joined
self_id = self._state.self_id