Browse Source

Allow enabling guild_progress_bar

pull/10109/head
dolfies 4 years ago
parent
commit
9503a1af83
  1. 6
      discord/guild.py
  2. 1
      discord/http.py

6
discord/guild.py

@ -1359,6 +1359,7 @@ class Guild(Hashable):
preferred_locale: str = MISSING, preferred_locale: str = MISSING,
rules_channel: Optional[TextChannel] = MISSING, rules_channel: Optional[TextChannel] = MISSING,
public_updates_channel: Optional[TextChannel] = MISSING, public_updates_channel: Optional[TextChannel] = MISSING,
premium_progress_bar_enabled: bool = MISSING,
) -> Guild: ) -> Guild:
r"""|coro| r"""|coro|
@ -1436,6 +1437,8 @@ class Guild(Hashable):
The new channel that is used for public updates from Discord. This is only available to 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 guilds that contain ``PUBLIC`` in :attr:`Guild.features`. Could be ``None`` for no
public updates channel. public updates channel.
premium_progress_bar_enabled: :class:`bool`
Whether the premium progress bar should be enabled.
reason: Optional[:class:`str`] reason: Optional[:class:`str`]
The reason for editing this guild. Shows up on the audit log. The reason for editing this guild. Shows up on the audit log.
@ -1555,6 +1558,9 @@ class Guild(Hashable):
fields['system_channel_flags'] = system_channel_flags.value fields['system_channel_flags'] = system_channel_flags.value
if premium_progress_bar_enabled is not MISSING:
fields['premium_progress_bar_enabled'] = premium_progress_bar_enabled
if community is not MISSING: if community is not MISSING:
features = [] features = []
if community: if community:

1
discord/http.py

@ -1186,6 +1186,7 @@ class HTTPClient:
'rules_channel_id', 'rules_channel_id',
'public_updates_channel_id', 'public_updates_channel_id',
'preferred_locale', 'preferred_locale',
'premium_progress_bar_enabled',
) )
payload = {k: v for k, v in fields.items() if k in valid_keys} payload = {k: v for k, v in fields.items() if k in valid_keys}

Loading…
Cancel
Save