Skip to content

Commit

Permalink
Support setting the preferred locale via Guild.edit
Browse files Browse the repository at this point in the history
Fix #6267
  • Loading branch information
Rapptz committed Jan 6, 2021
1 parent be18296 commit 3a75816
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,9 @@ async def edit(self, *, reason=None, **fields):
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
Expand Down Expand Up @@ -2167,7 +2170,7 @@ async def query_members(self, query=None, *, limit=5, user_ids=None, presences=F

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)

Expand Down
2 changes: 1 addition & 1 deletion discord/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def edit_guild(self, guild_id, *, reason=None, **fields):
'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
Expand Down

0 comments on commit 3a75816

Please sign in to comment.