Skip to content

Commit

Permalink
feat: audit logs for voice channel status (#2373)
Browse files Browse the repository at this point in the history
Co-authored-by: Lala Sabathil <aiko@aitsys.dev>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 2, 2024
1 parent 752a38c commit be87ae7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -97,6 +97,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2368](https://github.com/Pycord-Development/pycord/pull/2368))
- Added `Message.enforce_nonce`.
([#2370](https://github.com/Pycord-Development/pycord/pull/2370))
- Added audit log support for voice channel status.
([#2373](https://github.com/Pycord-Development/pycord/pull/2373))

### Changed

Expand Down
6 changes: 6 additions & 0 deletions discord/enums.py
Expand Up @@ -439,6 +439,8 @@ class AuditLogAction(Enum):
onboarding_update = 167
server_guide_create = 190
server_guide_update = 191
voice_channel_status_update = 192
voice_channel_status_delete = 193

@property
def category(self) -> AuditLogActionCategory | None:
Expand Down Expand Up @@ -506,6 +508,8 @@ def category(self) -> AuditLogActionCategory | None:
AuditLogAction.onboarding_update: AuditLogActionCategory.update,
AuditLogAction.server_guide_create: AuditLogActionCategory.create,
AuditLogAction.server_guide_update: AuditLogActionCategory.update,
AuditLogAction.voice_channel_status_update: AuditLogActionCategory.update,
AuditLogAction.voice_channel_status_delete: AuditLogActionCategory.delete,
}
return lookup[self]

Expand Down Expand Up @@ -552,6 +556,8 @@ def target_type(self) -> str | None:
return "onboarding"
elif v < 192:
return "server_guide"
elif v < 194:
return "voice_channel_status"


class UserFlags(Enum):
Expand Down
3 changes: 3 additions & 0 deletions discord/types/audit_log.py
Expand Up @@ -112,6 +112,7 @@ class _AuditLogChange_Str(TypedDict):
"deny",
"permissions",
"tags",
"status",
]
new_value: str
old_value: str
Expand Down Expand Up @@ -270,6 +271,8 @@ class AuditEntryInfo(TypedDict):
application_id: Snowflake
auto_moderation_rule_name: str
auto_moderation_rule_trigger_type: str
# TODO: add integration_type
status: str


class AuditLogEntry(TypedDict):
Expand Down

0 comments on commit be87ae7

Please sign in to comment.