diff --git a/CHANGELOG.md b/CHANGELOG.md index b1ddc2f1dc0..7ecb35fd6cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,14 @@ * Allow adding a mentionable argument to commands +## Changes + +* Make `Intent#values` a getter function. + ## Fixes * Mentionable arguments now correctly retrieve their entity. +* `Intent#values` emitting null when filtering. # 0.7.1 diff --git a/core/api/core.api b/core/api/core.api index cdbf4e1f467..318c865ee1b 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -5786,6 +5786,7 @@ public final class dev/kord/core/entity/interaction/InteractionKt { public static final fun channel (Ldev/kord/core/entity/interaction/OptionValue;)Ldev/kord/core/entity/channel/ResolvedChannel; public static final fun int (Ldev/kord/core/entity/interaction/OptionValue;)I public static final fun member (Ldev/kord/core/entity/interaction/OptionValue;)Ldev/kord/core/entity/Member; + public static final fun mentionable (Ldev/kord/core/entity/interaction/OptionValue;)Ldev/kord/core/entity/Entity; public static final fun role (Ldev/kord/core/entity/interaction/OptionValue;)Ldev/kord/core/entity/Role; public static final fun string (Ldev/kord/core/entity/interaction/OptionValue;)Ljava/lang/String; public static final fun user (Ldev/kord/core/entity/interaction/OptionValue;)Ldev/kord/core/entity/User; diff --git a/gateway/src/main/kotlin/Intent.kt b/gateway/src/main/kotlin/Intent.kt index 9c338a0c135..dd7b1153206 100644 --- a/gateway/src/main/kotlin/Intent.kt +++ b/gateway/src/main/kotlin/Intent.kt @@ -2,6 +2,7 @@ package dev.kord.gateway import dev.kord.common.DiscordBitSet import dev.kord.common.EmptyBitSet +import dev.kord.common.entity.Permission import kotlinx.serialization.KSerializer import kotlinx.serialization.Serializable import kotlinx.serialization.descriptors.PrimitiveKind @@ -153,7 +154,8 @@ sealed class Intent(val code: DiscordBitSet) { object DirectMessageTyping : Intent(1 shl 14) companion object { @OptIn(PrivilegedIntent::class) - val values = setOf( + val values: Set + get() = setOf( DirectMessageTyping, GuildIntegrations, GuildEmojis, diff --git a/rest/api/rest.api b/rest/api/rest.api index e00724704cb..98cc2c2d90f 100644 --- a/rest/api/rest.api +++ b/rest/api/rest.api @@ -625,6 +625,8 @@ public abstract class dev/kord/rest/builder/interaction/BaseApplicationBuilder { public final fun group (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public final fun int (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public static synthetic fun int$default (Ldev/kord/rest/builder/interaction/BaseApplicationBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V + public final fun mentionable (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public static synthetic fun mentionable$default (Ldev/kord/rest/builder/interaction/BaseApplicationBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V public final fun role (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public static synthetic fun role$default (Ldev/kord/rest/builder/interaction/BaseApplicationBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V public abstract fun setOptions (Ljava/util/List;)V @@ -769,6 +771,10 @@ public final class dev/kord/rest/builder/interaction/IntChoiceBuilder : dev/kord public synthetic fun choice (Ljava/lang/String;Ljava/lang/Object;)V } +public final class dev/kord/rest/builder/interaction/MentionableBuilder : dev/kord/rest/builder/interaction/OptionsBuilder { + public fun (Ljava/lang/String;Ljava/lang/String;)V +} + public abstract class dev/kord/rest/builder/interaction/OptionsBuilder : dev/kord/rest/builder/RequestBuilder { public synthetic fun (Ljava/lang/String;Ljava/lang/String;Ldev/kord/common/entity/ApplicationCommandOptionType;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun getDefault ()Ljava/lang/Boolean; @@ -870,6 +876,8 @@ public final class dev/kord/rest/builder/interaction/SubCommandBuilder : dev/kor public static synthetic fun channel$default (Ldev/kord/rest/builder/interaction/SubCommandBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V public final fun int (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public static synthetic fun int$default (Ldev/kord/rest/builder/interaction/SubCommandBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V + public final fun mentionable (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public static synthetic fun mentionable$default (Ldev/kord/rest/builder/interaction/SubCommandBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V public final fun role (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public static synthetic fun role$default (Ldev/kord/rest/builder/interaction/SubCommandBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V public final fun string (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V