diff options
| author | Nadir Chowdhury <[email protected]> | 2021-06-08 04:20:04 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-06-07 23:20:04 -0400 |
| commit | a7ae2eb1bb8ac9b995a236a31aba11118d08406a (patch) | |
| tree | db3c2e5f402c5067575c29221904d8eb67927e15 /discord/guild.py | |
| parent | Add Embed.remove_footer (diff) | |
| download | discord.py-a7ae2eb1bb8ac9b995a236a31aba11118d08406a.tar.xz discord.py-a7ae2eb1bb8ac9b995a236a31aba11118d08406a.zip | |
Add Guild.nsfw_level
Diffstat (limited to 'discord/guild.py')
| -rw-r--r-- | discord/guild.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/discord/guild.py b/discord/guild.py index 36317e47..e9756905 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -37,7 +37,7 @@ from .permissions import PermissionOverwrite from .colour import Colour from .errors import InvalidArgument, ClientException from .channel import * -from .enums import AuditLogAction, VideoQualityMode, VoiceRegion, ChannelType, try_enum, VerificationLevel, ContentFilter, NotificationLevel +from .enums import AuditLogAction, VideoQualityMode, VoiceRegion, ChannelType, try_enum, VerificationLevel, ContentFilter, NotificationLevel, NSFWLevel from .mixins import Hashable from .user import User from .invite import Invite @@ -167,9 +167,8 @@ class Guild(Hashable): preferred_locale: Optional[:class:`str`] The preferred locale for the guild. Used when filtering Server Discovery results to a specific language. - - nsfw: :class:`bool` - If the guild is marked as "not safe for work". + nsfw_level: :class:`NSFWLevel` + The guild's NSFW level. .. versionadded:: 2.0 """ @@ -183,7 +182,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', '_stage_instances', 'nsfw') + '_public_updates_channel_id', '_stage_instances', 'nsfw_level') _PREMIUM_GUILD_LIMITS = { None: _GuildLimit(emoji=50, bitrate=96e3, filesize=8388608), @@ -318,7 +317,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) + self.nsfw_level = try_enum(NSFWLevel, guild.get('nsfw_level', 0)) self._stage_instances = {} for s in guild.get('stage_instances', []): |