diff --git a/core/api/core.api b/core/api/core.api index d3c437381c6..3805ed74e66 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -4241,21 +4241,22 @@ public final class dev/kord/core/cache/data/InviteWithMetadataData$Companion { public final class dev/kord/core/cache/data/MemberData { public static final field Companion Ldev/kord/core/cache/data/MemberData$Companion; - public synthetic fun (ILdev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/GuildMemberFlags;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V - public fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/GuildMemberFlags;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V - public synthetic fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/GuildMemberFlags;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (ILdev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/GuildMemberFlags;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/GuildMemberFlags;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)V + public synthetic fun (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/GuildMemberFlags;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/kord/common/entity/Snowflake; public final fun component10 ()Ldev/kord/common/entity/optional/Optional; + public final fun component11 ()Ldev/kord/common/entity/optional/Optional; public final fun component2 ()Ldev/kord/common/entity/Snowflake; public final fun component3 ()Ldev/kord/common/entity/optional/Optional; public final fun component4 ()Ljava/util/List; public final fun component5 ()Lkotlinx/datetime/Instant; public final fun component6 ()Ldev/kord/common/entity/optional/Optional; public final fun component7 ()Ldev/kord/common/entity/GuildMemberFlags; - public final fun component8 ()Ldev/kord/common/entity/optional/OptionalBoolean; - public final fun component9 ()Ldev/kord/common/entity/optional/Optional; - public final fun copy (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/GuildMemberFlags;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/core/cache/data/MemberData; - public static synthetic fun copy$default (Ldev/kord/core/cache/data/MemberData;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/GuildMemberFlags;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/core/cache/data/MemberData; + public final fun component8 ()Ldev/kord/common/entity/optional/Optional; + public final fun component9 ()Ldev/kord/common/entity/optional/OptionalBoolean; + public final fun copy (Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/GuildMemberFlags;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;)Ldev/kord/core/cache/data/MemberData; + public static synthetic fun copy$default (Ldev/kord/core/cache/data/MemberData;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/Optional;Ljava/util/List;Lkotlinx/datetime/Instant;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/GuildMemberFlags;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/OptionalBoolean;Ldev/kord/common/entity/optional/Optional;Ldev/kord/common/entity/optional/Optional;ILjava/lang/Object;)Ldev/kord/core/cache/data/MemberData; public fun equals (Ljava/lang/Object;)Z public final fun getAvatar ()Ldev/kord/common/entity/optional/Optional; public final fun getCommunicationDisabledUntil ()Ldev/kord/common/entity/optional/Optional; @@ -4264,6 +4265,7 @@ public final class dev/kord/core/cache/data/MemberData { public final fun getJoinedAt ()Lkotlinx/datetime/Instant; public final fun getNick ()Ldev/kord/common/entity/optional/Optional; public final fun getPending ()Ldev/kord/common/entity/optional/OptionalBoolean; + public final fun getPermissions ()Ldev/kord/common/entity/optional/Optional; public final fun getPremiumSince ()Ldev/kord/common/entity/optional/Optional; public final fun getRoles ()Ljava/util/List; public final fun getUserId ()Ldev/kord/common/entity/Snowflake; @@ -6655,6 +6657,7 @@ public final class dev/kord/core/entity/Member : dev/kord/core/entity/User, dev/ public final fun getMemberAvatarHash ()Ljava/lang/String; public final fun getMemberData ()Ldev/kord/core/cache/data/MemberData; public final fun getNickname ()Ljava/lang/String; + public final fun getPermissions ()Ldev/kord/common/entity/Permissions; public final fun getPermissions (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun getPremiumSince ()Lkotlinx/datetime/Instant; public fun getPresence (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; diff --git a/core/src/commonMain/kotlin/cache/data/MemberData.kt b/core/src/commonMain/kotlin/cache/data/MemberData.kt index 4f99cf14e48..286a3bcc68d 100644 --- a/core/src/commonMain/kotlin/cache/data/MemberData.kt +++ b/core/src/commonMain/kotlin/cache/data/MemberData.kt @@ -19,6 +19,7 @@ public data class MemberData( val joinedAt: Instant, val premiumSince: Optional = Optional.Missing(), val flags: GuildMemberFlags, + val permissions: Optional = Optional.Missing(), val pending: OptionalBoolean = OptionalBoolean.Missing, val avatar: Optional = Optional.Missing(), val communicationDisabledUntil: Optional = Optional.Missing() @@ -53,6 +54,7 @@ public data class MemberData( joinedAt = joinedAt, premiumSince = premiumSince, flags = flags, + permissions = Optional.Value(permissions), pending = pending, avatar = avatar, communicationDisabledUntil = communicationDisabledUntil, diff --git a/core/src/commonMain/kotlin/entity/Member.kt b/core/src/commonMain/kotlin/entity/Member.kt index 54e053f6d5b..7bd6cd45d1d 100644 --- a/core/src/commonMain/kotlin/entity/Member.kt +++ b/core/src/commonMain/kotlin/entity/Member.kt @@ -11,6 +11,7 @@ import dev.kord.core.behavior.RoleBehavior import dev.kord.core.behavior.UserBehavior import dev.kord.core.cache.data.MemberData import dev.kord.core.cache.data.UserData +import dev.kord.core.entity.interaction.GuildInteraction import dev.kord.core.supplier.EntitySupplier import dev.kord.core.supplier.EntitySupplyStrategy import kotlinx.coroutines.flow.* @@ -93,6 +94,13 @@ public class Member( /** The [GuildMemberFlags] of this member. */ public val flags: GuildMemberFlags get() = memberData.flags + /** + * The total [Permissions] of this member in the channel an interaction was sent from. + * + * This is only non-null when obtained from a [GuildInteraction]. + */ + public val permissions: Permissions? get() = memberData.permissions.value + /** * Whether the user has not yet passed the guild's Membership Screening requirements. */