diff options
| author | Nadir Chowdhury <[email protected]> | 2019-03-14 01:24:16 +0000 |
|---|---|---|
| committer | Danny <[email protected]> | 2019-03-13 21:24:16 -0400 |
| commit | 8f7ce7c64e4b184b61b3f0309d6100ea621ee55a (patch) | |
| tree | 708a0d79577c53af03dc4cdfd8ad830581c8e60e /discord/guild.py | |
| parent | Fix imports (diff) | |
| download | discord.py-8f7ce7c64e4b184b61b3f0309d6100ea621ee55a.tar.xz discord.py-8f7ce7c64e4b184b61b3f0309d6100ea621ee55a.zip | |
Add support for reading guild descriptions
Added `Guild.description` and `PartialInviteGuild.description`.
Diffstat (limited to 'discord/guild.py')
| -rw-r--r-- | discord/guild.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/discord/guild.py b/discord/guild.py index 194f54e0..c67e041f 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -97,6 +97,8 @@ class Guild(Hashable): Check the :func:`on_guild_unavailable` and :func:`on_guild_available` events. banner: Optional[:class:`str`] The guild's banner. + description: Optional[:class:`str`] + The guild's description. mfa_level: :class:`int` Indicates the guild's two factor authorisation level. If this value is 0 then the guild does not require 2FA for their administrative members. If the value is @@ -125,7 +127,8 @@ class Guild(Hashable): '_default_role', '_roles', '_member_count', '_large', 'owner_id', 'mfa_level', 'emojis', 'features', 'verification_level', 'explicit_content_filter', 'splash', - '_voice_states', '_system_channel_id', 'default_notifications') + '_voice_states', '_system_channel_id', 'default_notifications', + 'description') def __init__(self, *, data, state): self._channels = {} @@ -227,6 +230,7 @@ class Guild(Hashable): self.features = guild.get('features', []) self.splash = guild.get('splash') self._system_channel_id = utils._get_as_snowflake(guild, 'system_channel_id') + self.description = guild.get('description') for mdata in guild.get('members', []): member = Member(data=mdata, guild=self, state=state) |