From 520ab8869341e22f87a98a97049a9d82f35ff3a1 Mon Sep 17 00:00:00 2001 From: lukellmann <47486203+lukellmann@users.noreply.github.com> Date: Fri, 13 Oct 2023 21:21:07 +0200 Subject: [PATCH] Fix DiscordAuditLogEntry.userId nullability (#885) It can be null as documented here: https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure See https://discord.com/channels/556525343595298817/1162448602115866716 --- common/src/commonMain/kotlin/entity/AuditLog.kt | 2 +- core/src/commonMain/kotlin/entity/AuditLog.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/commonMain/kotlin/entity/AuditLog.kt b/common/src/commonMain/kotlin/entity/AuditLog.kt index 1acd783c043..390c0b06042 100644 --- a/common/src/commonMain/kotlin/entity/AuditLog.kt +++ b/common/src/commonMain/kotlin/entity/AuditLog.kt @@ -108,7 +108,7 @@ public data class DiscordAuditLogEntry( val targetId: Snowflake?, val changes: Optional>> = Optional.Missing(), @SerialName("user_id") - val userId: Snowflake, + val userId: Snowflake?, val id: Snowflake, @SerialName("action_type") val actionType: AuditLogEvent, diff --git a/core/src/commonMain/kotlin/entity/AuditLog.kt b/core/src/commonMain/kotlin/entity/AuditLog.kt index 5de390c99e9..169a01e5949 100644 --- a/core/src/commonMain/kotlin/entity/AuditLog.kt +++ b/core/src/commonMain/kotlin/entity/AuditLog.kt @@ -53,7 +53,7 @@ public class AuditLogEntry(public val data: DiscordAuditLogEntry, override val k public val changes: List> get() = data.changes.orEmpty() - public val userId: Snowflake get() = data.userId + public val userId: Snowflake? get() = data.userId public val id: Snowflake get() = data.id