mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-22 00:13:01 +00:00
Add with_counts support for Client.fetch_guild
Co-authored-by: Stocker <44980366+StockerMC@users.noreply.github.com> Co-authored-by: Danny <Rapptz@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
bfaee44b1f
commit
e69428a841
@@ -255,6 +255,18 @@ class Guild(Hashable):
|
||||
|
||||
.. versionchanged:: 2.0
|
||||
This field is now an enum instead of an :class:`int`.
|
||||
|
||||
approximate_member_count: Optional[:class:`int`]
|
||||
The approximate number of members in the guild. This is ``None`` unless the guild is obtained
|
||||
using :meth:`Client.fetch_guild` with ``with_counts=True``.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
approximate_presence_count: Optional[:class:`int`]
|
||||
The approximate number of members currently active in the guild.
|
||||
Offline members are excluded. This is ``None`` unless the guild is obtained using
|
||||
:meth:`Client.fetch_guild` with ``with_counts=True``.
|
||||
|
||||
.. versionchanged:: 2.0
|
||||
"""
|
||||
|
||||
__slots__ = (
|
||||
@@ -297,6 +309,8 @@ class Guild(Hashable):
|
||||
'_stage_instances',
|
||||
'_scheduled_events',
|
||||
'_threads',
|
||||
'approximate_member_count',
|
||||
'approximate_presence_count',
|
||||
)
|
||||
|
||||
_PREMIUM_GUILD_LIMITS: ClassVar[Dict[Optional[int], _GuildLimit]] = {
|
||||
@@ -463,6 +477,8 @@ class Guild(Hashable):
|
||||
self._public_updates_channel_id: Optional[int] = utils._get_as_snowflake(guild, 'public_updates_channel_id')
|
||||
self.nsfw_level: NSFWLevel = try_enum(NSFWLevel, guild.get('nsfw_level', 0))
|
||||
self.mfa_level: MFALevel = try_enum(MFALevel, guild.get('mfa_level', 0))
|
||||
self.approximate_presence_count: Optional[int] = guild.get('approximate_presence_count')
|
||||
self.approximate_member_count: Optional[int] = guild.get('approximate_member_count')
|
||||
|
||||
self._stage_instances: Dict[int, StageInstance] = {}
|
||||
for s in guild.get('stage_instances', []):
|
||||
|
Reference in New Issue
Block a user