ConversationBuilder

abstract class ConversationBuilder(    val discord: Discord,     val user: User,     val channel: MessageChannel,     exitString: String? = null,     timeout: Long) : Responder

DSL for building a conversation.

Constructors

Link copied to clipboard
fun ConversationBuilder(    discord: Discord,     user: User,     channel: MessageChannel,     exitString: String? = null,     timeout: Long)

Functions

Link copied to clipboard
abstract suspend fun <I, O> prompt(    argument: Argument<I, O>,     text: String = "",     embed: suspend EmbedBuilder.() -> Unit? = null): O

Prompt the user with text and/or embed.

Link copied to clipboard
abstract suspend fun <T> promptButton(prompt: suspend ButtonPromptBuilder<T>.() -> Unit): T

Prompt the user with an embed and the provided buttons. Requires a call to both ButtonPromptBuilder.embed and ButtonPromptBuilder.buttons.

Link copied to clipboard
abstract suspend fun promptSelect(builder: SimpleSelectBuilder.() -> Unit): List<String>

Prompt the user with a select menu.

Link copied to clipboard
abstract suspend fun <T> promptUntil(    argument: Argument<*, T>,     prompt: String,     error: String,     isValid: (T) -> Boolean): T

Prompt the user with a String. Re-prompt until the response converts correctly. Then apply a custom predicate as an additional check.

Link copied to clipboard
open suspend fun respond(message: Any = "", embed: suspend EmbedBuilder.() -> Unit? = null): Message?

Create a response message with text and/or an embed.

Link copied to clipboard
open suspend fun respondMenu(menuBuilder: suspend MenuBuilder.() -> Unit): Message

Respond with a Menu.

Properties

Link copied to clipboard
abstract val botMessageIds: MutableList<Snowflake>

All ID's of messages sent by the bot in this conversation.

Link copied to clipboard
open override val channel: MessageChannel

The channel that this entity was invoked in.

Link copied to clipboard
val discord: Discord
Link copied to clipboard
val previousBotMessageId: Snowflake

The ID of the most recent message sent by the bot in this conversation.

Link copied to clipboard
val previousUserMessageId: Snowflake

The ID of the most recent message sent by the user in this conversation.

Link copied to clipboard
val responders: MutableList<ConversationResponder>

All responder objects that have been used to respond to user messages/interactions.

Link copied to clipboard
val user: User
Link copied to clipboard
abstract val userMessageIds: MutableList<Snowflake>

All ID's of messages sent by the user in this conversation.

Inheritors

Link copied to clipboard