BotDistrikt Documentation
  • 🟢Introduction
    • 👋Hello World
    • 🚀Quick Start
    • 🛠️Setup your Account
      • Register for BotDistrikt
      • Forgot Password
      • Chatbots Dashboard
      • Edit Profile
  • 📱Channels
    • Channels Overview
    • Website Chat
      • Website Chat Quick Start
      • Guest Users
    • Facebook Messenger
      • Import Existing Users
      • Facebook Chat Plugin
      • Facebook Checkbox Plugin
      • Facebook Private Replies
      • Facebook Ads Manager
    • Instagram
      • Import Existing Users
      • Instagram Story Mentions
    • Twitter
    • Skype
    • WhatsApp
      • Twilio WhatsApp Integration
    • Telegram
      • Telegram Commands
      • Telegram Groups
      • Telegram Channels
    • SMS
    • Google Assistant
    • WeChat
    • Other Channels
  • 🏆Features
    • Personality
    • Dashboard
    • Forms
    • Rules
      • Conditions
        • Message
        • User Attribute
    • Stories
      • Update Greeting and Fallback from Personality
    • Responses
      • Text
      • Cards
      • Images
      • Videos
      • Audios
      • Documents
      • Webhooks
      • Javascript Functions
    • Sources
      • Websites
      • Documents
      • Google Docs
      • Google Sheets
    • Users
      • Edit Users
      • Delete Users
      • Dear User
    • Inbox
      • Console
      • Messages
      • Reactions
      • Ratings
      • Clicks
      • Broadcast Records
      • Wrong Responses
    • Broadcasts
    • Settings
      • Tags
      • Audit Logs
      • Account
  • ⚙️How BotDistrikt Works
    • Interaction
    • Flow
    • Context
    • Engagement
    • Optimization
    • Artificial Intelligence
  • 🧠Artificial Intelligence
    • OpenAI
    • Vertex AI
    • Wit.ai
    • Dialogflow
      • Connecting to Dialogflow
      • Small Talk Module
        • Importing Responses
      • Multilanguage Support
  • 🧰Business Tools Integrations
    • Webhook
    • Zendesk
    • Chatbase
    • Google Docs
    • Google Sheets
    • Salesforce
  • API Reference
Powered by GitBook
On this page
  • Rule
  • Condition
  • Story

Was this helpful?

  1. How BotDistrikt Works

Flow

PreviousInteractionNextContext

Last updated 10 months ago

Was this helpful?

When a bot receives a message, it performs 2 tasks:

  1. Identify what to do

  2. Decide how to respond

The platform uses Rules to help your bot identify what to do, and Stories to help it decide how to respond. When creating a flow, configuring a rule first then a story next helps avoid duplicating stories.

Rule

A rule can also be considered a question from a user. When your bot receives a message, it tests the message against all its rules from the top rule (P1) to the bottom rule (PN). The first rule that passes the test is chosen as the Passing Rule.

Let's create a rule called "user is asking bank account balance" in our bot.

Rules are tested in order of appearance. Higher rules have higher priority (P1, P2, etc.), and lower rules have lower priority. Rules can be re-ordered in any way you want them to be tested.

A rule must have one or more conditions.

Condition

A boolean expression that returns true or false. When all conditions in a rule are true, the rule becomes the Passing Rule.

A condition tests only one context of a message-receiving interaction, either message, memory, user attributes, or NLP.

Each condition has 3 parts to it:

  • Property

  • Function

  • Value.

For our example above, we include two conditions (C1 and C2) to our rule:

Context

Property

Function

Value

C1

message

text

has keyword

balance

C2

memory

ask-bank-account

equals

true

This is a sample conversation with the rule above

User: My account Bot: Sure, what would you like to know? Bot uses an action to store a memory property: ask-bank-account, value: true ---------- User: What is my balance? Bot checks its rules and finds the Passing Rule: user is asking bank account balance. Bot has now IDENTIFIED WHAT TO DO

When the Passing Rule is found, the bot replies with the rule's Story.

Story

A collection of responses returned from the bot.

In its simplest form, consider a story an answer from the bot. It may contain one or many text, image, video, audio, document, card, location, and sticker responses. It can also be used to make your bot display buttons for the user to click, and perform certain actions on a context or trigger webhooks.

Let's create a story for the above example called "user is asking about bank balance".

In this story, we created 2 responses and 2 quick replies.

  1. Added a Webhook response to get the user's bank account information from our imaginary custom banking infrastructure, which returns a new memory property bank-balance.

  2. Added a Text Response displaying the bank balance with a Refresh Now button.

  3. Added 2 quick replies:

    1. How to improve

    2. Contact Customer Support.

The interaction in our example is complete

User: My account Bot: Sure, what would you like to know? Bot uses an action to store a memory property: ask-bank-account, value: true ---------- User: What is my balance? Bot checks its rules and the Passing Rule: user is asking bank account balance. Bot has now IDENTIFIED WHAT TO DO ---------- Bot selects the rule's story to DECIDE HOW TO RESPOND Bot: Your current balance $536.12

⚙️
Flow
Sample Rule for Bank Account Balance Query
Sample Story