Skip to content

Commit

Permalink
Merge pull request #348 from kordlib/0.7.x
Browse files Browse the repository at this point in the history
0.7.4
  • Loading branch information
BartArys authored Jul 20, 2021
2 parents df9ad86 + f116b8f commit e3d97c2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 0.7.4

## Changes

* Promote user property in component interaction to a data object.

## Fixes

* Fixed `ComponentInteraction#user` throwing a `NullPointerException` when the interaction was created in a direct message.

# 0.7.3

## Additions
Expand Down
3 changes: 2 additions & 1 deletion core/api/core.api
Original file line number Diff line number Diff line change
Expand Up @@ -5735,7 +5735,8 @@ public abstract class dev/kord/core/entity/interaction/ComponentInteraction : de
public abstract fun getComponent ()Ldev/kord/core/entity/component/Component;
public final fun getComponentId ()Ljava/lang/String;
public final fun getMessage ()Ldev/kord/core/entity/Message;
public fun getUser ()Ldev/kord/core/behavior/UserBehavior;
public synthetic fun getUser ()Ldev/kord/core/behavior/UserBehavior;
public fun getUser ()Ldev/kord/core/entity/User;
public fun hashCode ()I
public abstract fun toString ()Ljava/lang/String;
public abstract fun withStrategy (Ldev/kord/core/supplier/EntitySupplyStrategy;)Ldev/kord/core/entity/interaction/ComponentInteraction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package dev.kord.core.entity.interaction
import dev.kord.common.annotation.KordPreview
import dev.kord.common.entity.ComponentType
import dev.kord.common.entity.Snowflake
import dev.kord.common.entity.optional.map
import dev.kord.common.entity.optional.orEmpty
import dev.kord.common.entity.optional.unwrap
import dev.kord.core.Kord
import dev.kord.core.behavior.UserBehavior
import dev.kord.core.behavior.interaction.ComponentInteractionBehavior
import dev.kord.core.cache.data.InteractionData
import dev.kord.core.entity.Message
import dev.kord.core.entity.User
import dev.kord.core.entity.component.ActionRowComponent
import dev.kord.core.entity.component.ButtonComponent
import dev.kord.core.entity.component.Component
Expand All @@ -27,8 +29,9 @@ import dev.kord.rest.builder.component.SelectMenuBuilder
@KordPreview
sealed class ComponentInteraction : Interaction(), ComponentInteractionBehavior {

override val user: UserBehavior
get() = UserBehavior(data.member.value!!.userId, kord)
override val user: User
get() = User(data.user.value!!, kord)


/**
* The message that contains the interacted component, null if the message is ephemeral.
Expand Down

0 comments on commit e3d97c2

Please sign in to comment.