start Publicly
inline suspend fun startPublicly( discord: Discord, user: User, channel: MessageChannel): ConversationResult
Content copied to clipboard
Start a conversation with someone in a public channel.
Return
The result of the conversation indicated by an enum.
Samples
import dev.kord.core.entity.Message
import dev.kord.core.entity.User
import dev.kord.core.entity.channel.MessageChannel
import dev.kord.core.entity.interaction.ComponentInteraction
import me.jakejmattson.discordkt.Discord
import me.jakejmattson.discordkt.TypeContainer
import me.jakejmattson.discordkt.commands.SlashCommandEvent
import me.jakejmattson.discordkt.internal.annotations.BuilderDSL
fun main() {
//sampleStart
/**
* An enum representing possible ways that a conversation can end.
*/
public enum class ConversationResult {
/** The target user cannot be reached - a bot or no shared guild. */
INVALID_USER,
/** The target user has the bot blocked or has DMs off. */
CANNOT_DM,
/** The target user already has a conversation. */
HAS_CONVERSATION,
/** The conversation prompt timed out with no fallback. */
TIMED_OUT,
/** The conversation has completed successfully. */
COMPLETE,
/** The conversation was exited by the user. */
EXITED
}
//sampleEnd
}
Parameters
user
The user to start a conversation with.
channel
The guild channel to start the conversation in.