From 256c5804801beb6b97a07b60d2fcdecacefebbb6 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Fri, 27 Oct 2023 22:15:58 +0100 Subject: [PATCH] Add GenericInteractionContext --- .../kord/extensions/types/InteractionContext.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/types/InteractionContext.kt b/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/types/InteractionContext.kt index 30599455bc..128e5df3f7 100644 --- a/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/types/InteractionContext.kt +++ b/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/types/InteractionContext.kt @@ -18,12 +18,18 @@ import dev.kord.rest.builder.message.create.FollowupMessageCreateBuilder import dev.kord.rest.builder.message.modify.InteractionResponseModifyBuilder import java.util.* +/** Type alias for a generic interaction context, meant to be used with extension functions. **/ +public typealias GenericInteractionContext = InteractionContext<*, *, *, *> + /** * Interface representing an interaction context. Provides a generic base type for action contexts when working * with interactions. * * More specific types representing each interaction type (ephemeral/public) extend this class. * + * If you're writing an extension function, you'll likely want to use [GenericInteractionContext] as the + * receiver type. + * * @param ResponseBehavior Generic representing the relevant interaction response behavior. * @param FollowupType Generic representing the follow-up type for the current interaction type. * @param OppositeFollowupType Generic representing the opposite follow-up type for the current interaction type.