Skip to content

Commit

Permalink
Add support for toggling premium_progress_bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorukyum committed Oct 26, 2021
1 parent fc58675 commit 0681805
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,7 @@ async def edit(
preferred_locale: str = MISSING,
rules_channel: Optional[TextChannel] = MISSING,
public_updates_channel: Optional[TextChannel] = MISSING,
premium_progress_bar_enabled: bool = MISSING,
) -> Guild:
r"""|coro|
Expand Down Expand Up @@ -1453,6 +1454,8 @@ async def edit(
The new channel that is used for public updates from Discord. This is only available to
guilds that contain ``PUBLIC`` in :attr:`Guild.features`. Could be ``None`` for no
public updates channel.
premium_progress_bar_enabled: :class:`bool`
Whether the guild should have premium progress bar enabled.
reason: Optional[:class:`str`]
The reason for editing this guild. Shows up on the audit log.
Expand Down Expand Up @@ -1583,6 +1586,9 @@ async def edit(
)

fields['features'] = features

if premium_progress_bar_enabled is not MISSING:
fields['premium_progress_bar_enabled'] = premium_progress_bar_enabled

data = await http.edit_guild(self.id, reason=reason, **fields)
return Guild(data=data, state=self._state)
Expand Down
1 change: 1 addition & 0 deletions discord/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,7 @@ def edit_guild(self, guild_id: Snowflake, *, reason: Optional[str] = None, **fie
'rules_channel_id',
'public_updates_channel_id',
'preferred_locale',
'premium_progress_bar_enabled',
)

payload = {k: v for k, v in fields.items() if k in valid_keys}
Expand Down

0 comments on commit 0681805

Please sign in to comment.