aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-01-05 22:43:22 -0500
committerRapptz <[email protected]>2021-01-05 22:43:22 -0500
commit3a75816ba127362836b20edf7003ce7afd33d0f9 (patch)
tree22572ff4f6a19221c5fbedf9645f4744a1253565
parentUpdate intents.rst & discord.rst (diff)
downloaddiscord.py-3a75816ba127362836b20edf7003ce7afd33d0f9.tar.xz
discord.py-3a75816ba127362836b20edf7003ce7afd33d0f9.zip
Support setting the preferred locale via Guild.edit
Fix #6267
-rw-r--r--discord/guild.py5
-rw-r--r--discord/http.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/discord/guild.py b/discord/guild.py
index 2dd6a012..f78a7315 100644
--- a/discord/guild.py
+++ b/discord/guild.py
@@ -1084,6 +1084,9 @@ class Guild(Hashable):
The new channel that is used for the system channel. Could be ``None`` for no system channel.
system_channel_flags: :class:`SystemChannelFlags`
The new system channel settings to use with the new system channel.
+ preferred_locale: :class:`str`
+ The new preferred locale for the guild. Used as the primary language in the guild.
+ If set, this must be an ISO 639 code, e.g. ``en-US`` or ``ja`` or ``zh-CN``.
rules_channel: Optional[:class:`TextChannel`]
The new channel that is used for rules. This is only available to
guilds that contain ``PUBLIC`` in :attr:`Guild.features`. Could be ``None`` for no rules
@@ -2167,7 +2170,7 @@ class Guild(Hashable):
if user_ids is not None and query is not None:
raise ValueError('Cannot pass both query and user_ids')
-
+
limit = min(100, limit or 5)
return await self._state.query_members(self, query=query, limit=limit, user_ids=user_ids, presences=presences, cache=cache)
diff --git a/discord/http.py b/discord/http.py
index 887632f9..b90c6b85 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -659,7 +659,7 @@ class HTTPClient:
'system_channel_id', 'default_message_notifications',
'description', 'explicit_content_filter', 'banner',
'system_channel_flags', 'rules_channel_id',
- 'public_updates_channel_id')
+ 'public_updates_channel_id', 'preferred_locale',)
payload = {
k: v for k, v in fields.items() if k in valid_keys