Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: voice message support #2016

Merged
merged 17 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: add voice message perm and message flag
  • Loading branch information
Lulalaby authored Apr 14, 2023
commit 099fc33e61c3b110fee5752f27a6eca045ae2dd5
8 changes: 8 additions & 0 deletions discord/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,14 @@ def suppress_notifications(self):

return 4096

@flag_value
def is_voice_message(self):
""":class:`bool`: Returns ``True`` if this message is a voice message.

.. versionadded:: 2.4
Lulalaby marked this conversation as resolved.
Show resolved Hide resolved
"""
return 8192


@fill_with_flags()
class PublicUserFlags(BaseFlags):
Expand Down
9 changes: 9 additions & 0 deletions discord/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,14 @@ def moderate_members(self) -> int:
"""
return 1 << 40

@flag_value
def send_voice_messages(self) -> int:
""":class:`bool`: Returns ``True`` if a umember can send voice messages.
Lulalaby marked this conversation as resolved.
Show resolved Hide resolved

.. versionadded:: 2.4
Lulalaby marked this conversation as resolved.
Show resolved Hide resolved
"""
return 1 << 46


PO = TypeVar("PO", bound="PermissionOverwrite")

Expand Down Expand Up @@ -727,6 +735,7 @@ class PermissionOverwrite:
use_external_stickers: bool | None
start_embedded_activities: bool | None
moderate_members: bool | None
send_voice_messages: bool | None

def __init__(self, **kwargs: bool | None):
self._values: dict[str, bool | None] = {}
Expand Down