Skip to content

Commit ed069c2

Browse files
committed
Default with_counts to True in fetch_guilds
1 parent 5d79d0e commit ed069c2

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

discord/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ def fetch_guilds(
14621462
limit: int | None = 100,
14631463
before: SnowflakeTime = None,
14641464
after: SnowflakeTime = None,
1465-
with_counts: bool = False,
1465+
with_counts: bool = True,
14661466
) -> GuildIterator:
14671467
"""Retrieves an :class:`.AsyncIterator` that enables receiving your guilds.
14681468
@@ -1494,6 +1494,7 @@ def fetch_guilds(
14941494
Whether to include count information in the guilds. This fills the
14951495
:attr:`.Guild.approximate_member_count` and :attr:`.Guild.approximate_presence_count`
14961496
fields.
1497+
Defaults to ``True``.
14971498
14981499
Yields
14991500
------
@@ -1520,7 +1521,7 @@ def fetch_guilds(
15201521
15211522
All parameters are optional.
15221523
"""
1523-
return GuildIterator(self, limit=limit, before=before, after=after)
1524+
return GuildIterator(self, limit=limit, before=before, after=after, with_counts=with_counts)
15241525

15251526
async def fetch_template(self, code: Template | str) -> Template:
15261527
"""|coro|

discord/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ def get_guilds(
14451445
limit: int,
14461446
before: Snowflake | None = None,
14471447
after: Snowflake | None = None,
1448-
with_counts: bool = False,
1448+
with_counts: bool = True,
14491449
) -> Response[list[guild.Guild]]:
14501450
params: dict[str, Any] = {
14511451
"limit": limit,

discord/iterators.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,14 @@ class GuildIterator(_AsyncIterator["Guild"]):
585585
Object before which all guilds must be.
586586
after: Optional[Union[:class:`abc.Snowflake`, :class:`datetime.datetime`]]
587587
Object after which all guilds must be.
588+
with_counts: Optional[:class:`bool`]
589+
Whether to include count information in the guilds. This fills the
590+
:attr:`.Guild.approximate_member_count` and :attr:`.Guild.approximate_presence_count`
591+
fields.
592+
Defaults to ``True``.
588593
"""
589594

590-
def __init__(self, bot, limit, before=None, after=None, with_counts=False):
595+
def __init__(self, bot, limit, before=None, after=None, with_counts=True):
591596
if isinstance(before, datetime.datetime):
592597
before = Object(id=time_snowflake(before, high=False))
593598
if isinstance(after, datetime.datetime):

0 commit comments

Comments
 (0)