Skip to content

Commit

Permalink
Fix Intent#values emitting null
Browse files Browse the repository at this point in the history
  • Loading branch information
HopeBaron committed Jun 25, 2021
1 parent 4f1e5e3 commit 2d4afce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion gateway/src/main/kotlin/Intent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<Intent>
get() = setOf(
DirectMessageTyping,
GuildIntegrations,
GuildEmojis,
Expand Down

0 comments on commit 2d4afce

Please sign in to comment.