Skip to content

Commit

Permalink
feat: audit logs for voice channel status
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorukyum committed Mar 1, 2024
1 parent 752a38c commit 0d113d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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 0d113d2

Please sign in to comment.