Skip to content

Commit 968a586

Browse files
Paillat-devplun1331Dorukyum
authored
feat: ✨ Add missing soundboard and monetization permissions (#2620)
* ✨ Soundboard perms (`1 << 42`, `1 << 45`) * ✨ Add creator monetization analytics perms (`1 << 41`) * 📝 CHANGELOG.md * Update CHANGELOG.md Signed-off-by: Dorukyum <[email protected]> --------- Signed-off-by: Dorukyum <[email protected]> Co-authored-by: plun1331 <[email protected]> Co-authored-by: Dorukyum <[email protected]>
1 parent 48c5950 commit 968a586

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ These changes are available on the `master` branch, but have not yet been releas
3232
([#2590](https://github.com/Pycord-Development/pycord/pull/2590))
3333
- Added missing `with_counts` parameter to `fetch_guilds` method.
3434
([#2615](https://github.com/Pycord-Development/pycord/pull/2615))
35+
- Added missing permissions: `Permissions.use_soundboard`,
36+
`Permissions.use_external_sounds` and
37+
`Permissions.view_creator_monetization_analytics`.
38+
([#2620](https://github.com/Pycord-Development/pycord/pull/2620))
3539

3640
### Fixed
3741

discord/permissions.py

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def all_channel(cls: type[P]) -> P:
191191
- :attr:`manage_emojis`
192192
- :attr:`view_audit_log`
193193
- :attr:`view_guild_insights`
194+
- :attr:`view_creator_monetization_analytics`
194195
- :attr:`manage_guild`
195196
- :attr:`change_nickname`
196197
- :attr:`manage_nicknames`
@@ -218,8 +219,10 @@ def general(cls: type[P]) -> P:
218219
permissions :attr:`administrator`, :attr:`create_instant_invite`, :attr:`kick_members`,
219220
:attr:`ban_members`, :attr:`change_nickname` and :attr:`manage_nicknames` are
220221
no longer part of the general permissions.
222+
.. versionchanged:: 2.7
223+
Added :attr:`view_creator_monetization_analytics` permission.
221224
"""
222-
return cls(0b01110000000010000000010010110000)
225+
return cls(0b100000000001110000000010000000010010110000)
223226

224227
@classmethod
225228
def membership(cls: type[P]) -> P:
@@ -250,7 +253,7 @@ def voice(cls: type[P]) -> P:
250253
"""A factory method that creates a :class:`Permissions` with all
251254
"Voice" permissions from the official Discord UI set to ``True``.
252255
"""
253-
return cls(0b1000000001000000000000011111100000000001100000000)
256+
return cls(0b1001001001000000000000011111100000000001100000000)
254257

255258
@classmethod
256259
def stage(cls: type[P]) -> P:
@@ -610,6 +613,30 @@ def moderate_members(self) -> int:
610613
"""
611614
return 1 << 40
612615

616+
@flag_value
617+
def view_creator_monetization_analytics(self) -> int:
618+
""":class:`bool`: Returns ``True`` if a user can view creator monetization (role subscription) analytics.
619+
620+
.. versionadded:: 2.7
621+
"""
622+
return 1 << 41
623+
624+
@flag_value
625+
def use_soundboard(self) -> int:
626+
""":class:`bool`: Returns ``True`` if a user can use the soundboard in a voice channel.
627+
628+
.. versionadded:: 2.7
629+
"""
630+
return 1 << 42
631+
632+
@flag_value
633+
def use_external_sounds(self) -> int:
634+
""":class:`bool`: Returns ``True`` if a user can use external soundboard sounds in a voice channel.
635+
636+
.. versionadded:: 2.7
637+
"""
638+
return 1 << 45
639+
613640
@flag_value
614641
def send_voice_messages(self) -> int:
615642
""":class:`bool`: Returns ``True`` if a member can send voice messages.
@@ -762,6 +789,8 @@ class PermissionOverwrite:
762789
use_external_stickers: bool | None
763790
start_embedded_activities: bool | None
764791
moderate_members: bool | None
792+
use_soundboard: bool | None
793+
use_external_sounds: bool | None
765794
send_voice_messages: bool | None
766795
set_voice_channel_status: bool | None
767796
send_polls: bool | None

0 commit comments

Comments
 (0)