Skip to content

Commit 26c85e4

Browse files
authored
Merge pull request #331 from Dorukyum/premium-progress-bar
Add `guild.premium_progress_bar_enabled`
2 parents 039319b + 0681805 commit 26c85e4

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

discord/guild.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ class Guild(Hashable):
239239
The number goes from 0 to 3 inclusive.
240240
premium_subscription_count: :class:`int`
241241
The number of "boosts" this guild currently has.
242+
premium_progress_bar_enabled: :class:`bool`
243+
Indicates if the guild has premium progress bar enabled.
244+
245+
.. versionadded:: 2.0
242246
preferred_locale: Optional[:class:`str`]
243247
The preferred locale for the guild. Used when filtering Server Discovery
244248
results to a specific language.
@@ -269,6 +273,7 @@ class Guild(Hashable):
269273
'max_video_channel_users',
270274
'premium_tier',
271275
'premium_subscription_count',
276+
'premium_progress_bar_enabled',
272277
'preferred_locale',
273278
'nsfw_level',
274279
'_members',
@@ -449,6 +454,7 @@ def _from_data(self, guild: GuildPayload) -> None:
449454
self.max_video_channel_users: Optional[int] = guild.get('max_video_channel_users')
450455
self.premium_tier: int = guild.get('premium_tier', 0)
451456
self.premium_subscription_count: int = guild.get('premium_subscription_count') or 0
457+
self.premium_progress_bar_enabled: bool = guild.get('premium_progress_bar_enabled') or False
452458
self._system_channel_flags: int = guild.get('system_channel_flags', 0)
453459
self.preferred_locale: Optional[str] = guild.get('preferred_locale')
454460
self._discovery_splash: Optional[str] = guild.get('discovery_splash')
@@ -1370,6 +1376,7 @@ async def edit(
13701376
preferred_locale: str = MISSING,
13711377
rules_channel: Optional[TextChannel] = MISSING,
13721378
public_updates_channel: Optional[TextChannel] = MISSING,
1379+
premium_progress_bar_enabled: bool = MISSING,
13731380
) -> Guild:
13741381
r"""|coro|
13751382
@@ -1447,6 +1454,8 @@ async def edit(
14471454
The new channel that is used for public updates from Discord. This is only available to
14481455
guilds that contain ``PUBLIC`` in :attr:`Guild.features`. Could be ``None`` for no
14491456
public updates channel.
1457+
premium_progress_bar_enabled: :class:`bool`
1458+
Whether the guild should have premium progress bar enabled.
14501459
reason: Optional[:class:`str`]
14511460
The reason for editing this guild. Shows up on the audit log.
14521461
@@ -1577,6 +1586,9 @@ async def edit(
15771586
)
15781587

15791588
fields['features'] = features
1589+
1590+
if premium_progress_bar_enabled is not MISSING:
1591+
fields['premium_progress_bar_enabled'] = premium_progress_bar_enabled
15801592

15811593
data = await http.edit_guild(self.id, reason=reason, **fields)
15821594
return Guild(data=data, state=self._state)

discord/http.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,7 @@ def edit_guild(self, guild_id: Snowflake, *, reason: Optional[str] = None, **fie
10771077
'rules_channel_id',
10781078
'public_updates_channel_id',
10791079
'preferred_locale',
1080+
'premium_progress_bar_enabled',
10801081
)
10811082

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

discord/types/guild.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class _GuildOptional(TypedDict, total=False):
6666
max_presences: Optional[int]
6767
max_members: int
6868
premium_subscription_count: int
69+
premium_progress_bar_enabled: bool
6970
max_video_channel_users: int
7071

7172

0 commit comments

Comments
 (0)