startPrivately

inline suspend fun startPrivately(discord: Discord, user: User): ConversationResult

Start a conversation with someone in their private messages.

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.