Options
All
  • Public
  • Public/Protected
  • All
Menu

Extensible set of built-in prompts. For TypeScript developers you can use interface decliration merging to add new global prompts in a way that will be TypeScript aware.

Hierarchy

  • IPrompts

Index

Methods

attachment

  • Prompts the user to upload a file attachment.

    Parameters

    • session: Session

      Session object for the current conversation.

    • prompt: TextOrMessageType
      • prompt: {string} - Initial message to send the user.
      • prompt: {string[]} - Array of possible messages to send user. One will be chosen at random.
      • prompt: {IMessage|IIsMessage} - Initial message to send the user. Message can contain attachments.
    • Optional options: IPromptAttachmentOptions

      (Optional) parameters to control the behaviour of the prompt.

    Returns void

choice

  • Prompts the user to choose from a list of options.

    Parameters

    • session: Session

      Session object for the current conversation.

    • prompt: TextOrMessageType
      • prompt: {string} - Initial message to send the user.
      • prompt: {string[]} - Array of possible messages to send user. One will be chosen at random.
      • prompt: {IMessage|IIsMessage} - Initial message to send the user. Message can contain attachments. Any listStyle options will be ignored.
    • choices: string | Object | string[] | IChoice[]
      • choices: {string} - List of choices as a pipe ('|') delimted string.
      • choices: {Object} - List of choices expressed as an Object map. The objects field names will be used to build the list of values.
      • choices: {string[]} - List of choices as an array of strings.
      • choices: {IChoice[]} - List of choices as an array of IChoice objects.
    • Optional options: IPromptChoiceOptions

      (Optional) parameters to control the behaviour of the prompt.

    Returns void

configure

confirm

  • Prompts the user to confirm an action with a yes/no response.

    Parameters

    • session: Session

      Session object for the current conversation.

    • prompt: TextOrMessageType
      • prompt: {string} - Initial message to send the user.
      • prompt: {string[]} - Array of possible messages to send user. One will be chosen at random.
      • prompt: {IMessage|IIsMessage} - Initial message to send the user. Message can contain attachments.
    • Optional options: IPromptOptions

      (Optional) parameters to control the behaviour of the prompt.

    Returns void

customize

  • Replaces a built-in prompt with a new implementation. This lets you completely customize the way a prompt like builder.Prompts.time() works globally.

    Parameters

    • type: PromptType

      The type of built-in prompt that you're customizing.

    • dialog: Dialog

      The dialog that you wish to use in place of the default prompt. Be aware that your dialog will be registered in the system namespace ('BotBuilder') which can potentially impact localization and calls to session.beginDialog(). For calls to beginDialog() from within your custom prompt you'll want to prefix your dialogID's with the namespace of the library you're calling into, typically '' for the bots default namespace. So you would use `session.beginDialog(':help');` to call a "help" dialog from your custom prompt.

    Returns IPrompts

disambiguate

  • Prompts the user to disambiguate multiple triggered actions. Should typically be called from UniversalBot.onDisambiguateRoute().

    example
    
    builder.Prompts.disambiguate(session, "What would you like to cancel?", {
         "Cancel Item": cancelItemRoute,
         "Cancel Order": cancelOrderRoute,
         "Neither": null
    });
    

    Parameters

    • session: Session

      Session object for the current conversation.

    • prompt: TextOrMessageType
      • prompt: {string} - Initial message to send the user.
      • prompt: {string[]} - Array of possible messages to send user. One will be chosen at random.
      • prompt: {IMessage|IIsMessage} - Initial message to send the user. Message can contain attachments.
    • choices: IDisambiguateChoices

      Map of routes to select from. The key is the choice label that will be displayed to the user.

    • Optional options: IPromptOptions

      (Optional) parameters to control the behaviour of the prompt.

    Returns void

number

  • Prompts the user to enter a number.

    Parameters

    • session: Session

      Session object for the current conversation.

    • prompt: TextOrMessageType
      • prompt: {string} - Initial message to send the user.
      • prompt: {string[]} - Array of possible messages to send user. One will be chosen at random.
      • prompt: {IMessage|IIsMessage} - Initial message to send the user. Message can contain attachments.
    • Optional options: IPromptNumberOptions

      (Optional) parameters to control the behaviour of the prompt.

    Returns void

text

  • Captures from the user a raw string of text.

    Parameters

    • session: Session

      Session object for the current conversation.

    • prompt: TextOrMessageType
      • prompt: {string} - Initial message to send the user.
      • prompt: {string[]} - Array of possible messages to send user. One will be chosen at random.
      • prompt: {IMessage|IIsMessage} - Initial message to send the user. Message can contain attachments.
    • Optional options: IPromptOptions

      (Optional) parameters to control the behaviour of the prompt.

    Returns void

time

  • Prompts the user to enter a time.

    Parameters

    • session: Session

      Session object for the current conversation.

    • prompt: TextOrMessageType
      • prompt: {string} - Initial message to send the user.
      • prompt: {string[]} - Array of possible messages to send user. One will be chosen at random.
      • prompt: {IMessage|IIsMessage} - Initial message to send the user. Message can contain attachments.
    • Optional options: IPromptOptions

      (Optional) parameters to control the behaviour of the prompt.

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method