All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.freya02.botcommands.api.components.ComponentGroup.kt Maven / Gradle / Ivy

package com.freya02.botcommands.api.components

import com.freya02.botcommands.internal.components.controller.ComponentController
import kotlinx.coroutines.TimeoutCancellationException
import net.dv8tion.jda.api.events.interaction.component.GenericComponentInteractionCreateEvent

class ComponentGroup internal constructor(private val componentController: ComponentController, private val id: String) : IdentifiableComponent {
    override fun getId(): String = id

    /**
     * **Awaiting on a component that is part of a group is undefined behavior**
     *
     * @throws TimeoutCancellationException If the timeout set in the component builder has been reached
     * @throws ClassCastException If the received event cannot be cast to the requested type
     */
    @JvmSynthetic
    suspend fun  await(): T = componentController.awaitComponent(this)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy