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: audit logs for voice channel status #2373

Merged
merged 3 commits into from Mar 2, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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