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

Add voice channel status events and permission #9604

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
Prev Previous commit
Next Next commit
Merge branch 'master' into voice-status-rest
  • Loading branch information
Puncher1 committed Oct 21, 2023
commit 125f5c20cfec4fd150591e1a456d88d1444f75b0
12 changes: 12 additions & 0 deletions discord/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,18 @@ def parse_voice_channel_status_update(self, data: gw.VoiceChannelStatusUpdate) -
else:
_log.debug('VOICE_CHANNEL_STATUS_UPDATE referencing unknown guild ID: %s. Discarding.', data['guild_id'])

def parse_entitlement_create(self, data: gw.EntitlementCreateEvent) -> None:
entitlement = Entitlement(data=data, state=self)
self.dispatch('entitlement_create', entitlement)

def parse_entitlement_update(self, data: gw.EntitlementUpdateEvent) -> None:
entitlement = Entitlement(data=data, state=self)
self.dispatch('entitlement_update', entitlement)

def parse_entitlement_delete(self, data: gw.EntitlementDeleteEvent) -> None:
entitlement = Entitlement(data=data, state=self)
self.dispatch('entitlement_delete', entitlement)

def _get_reaction_user(self, channel: MessageableChannel, user_id: int) -> Optional[Union[User, Member]]:
if isinstance(channel, (TextChannel, Thread, VoiceChannel)):
return channel.guild.get_member(user_id)
Expand Down
3 changes: 3 additions & 0 deletions discord/types/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,6 @@ class VoiceChannelStatusUpdate(TypedDict):
id: Snowflake
guild_id: Snowflake
status: Optional[str]


EntitlementCreateEvent = EntitlementUpdateEvent = EntitlementDeleteEvent = Entitlement
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.