Audit log entry schema

This commit is contained in:
Rory&
2026-08-31 04:59:03 +02:00
parent 3bfd76dc5a
commit b3b98bf72a
3 changed files with 12 additions and 2 deletions
Binary file not shown.
Binary file not shown.
+12 -2
View File
@@ -16,11 +16,11 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { AutomodRuleSchema, ChannelPermissionOverwrite, PartialUser, PublicChannel, WebhookResponse } from "@spacebar/schemas";
import { AutomodRuleSchema, ChannelPermissionOverwrite, PartialUser, PublicChannel, Snowflake, WebhookResponse } from "@spacebar/schemas";
// Note: some audit log event types have some special keys: https://docs.discord.food/resources/audit-log#audit-log-change-exceptions
export interface AuditLogResponse {
audit_log_entries: unknown[]; // TODO: type
audit_log_entries: AuditLogEntry[];
application_commands: unknown[]; // TODO: type
auto_moderation_rules: AutomodRuleSchema[];
guild_scheduled_events: unknown[]; // TODO: type
@@ -30,6 +30,16 @@ export interface AuditLogResponse {
webhooks: WebhookResponse[];
}
export interface AuditLogEntry {
id: Snowflake;
action_type: AuditLogEvents;
user_id: Snowflake | null;
target_id: Snowflake | null;
changes?: AuditLogChange[];
options?: unknown;
reason?: string;
}
export enum AuditLogEvents {
// guild level
GUILD_UPDATE = 1,