From 2d4afce72d385f281d542487a5c104593ecbf116 Mon Sep 17 00:00:00 2001 From: HopeBaron Date: Fri, 25 Jun 2021 22:41:54 +0300 Subject: [PATCH] Fix Intent#values emitting null --- CHANGELOG.md | 5 +++++ gateway/src/main/kotlin/Intent.kt | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) 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/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,