Stella Platform Documentation

Stella Platform Documentation

  • Docs
  • Procedures
  • Reference
  • FAQ
  • Bot API
  • API
  • Languages iconEnglish
    • 中文

›Slack Live Chat Tree Setup

Get Started

  • Build your First Chatbot

Basic Facebook Chatbot Setup

  • Overview
  • 1.1: Connect to Channels
  • 1.2: Create New Tree
  • 1.3: Build the First Node
  • 1.4: Create a Global Node
  • 1.5: Build Child Nodes
  • 2.1: Production Channel
  • 3.1: Draft a Post
  • 3.2: Create Comment Reply

Basic Instagram Chatbot Setup

  • Overview
  • 1.1: Connect to Channels
  • 1.2: Create New Tree
  • 1.3: Build the First Node
  • 1.4: Create Global Node
  • 1.5: Build Child Nodes
  • 2.1: Create Story Mention
  • 2.2: Create Comment Reply
  • 2.3: Send Push Message

Basic Web Chat Chatbot Setup

  • Overview
  • 1.1: Connect to Channels
  • 1.2: Create New Tree
  • 1.3: Build the First Node
  • 1.4: Create a Global Node
  • 1.5: Build Child Nodes

Basic WhatsApp Chatbot Setup

  • Overview
  • 1.1: WABA Subscription
  • 1.2: Connect WABA
  • 1.3: Check Approval Status of WABA
  • 1.4: Setup WABA with Used WhatsApp Number
  • 1.5: Reset / Terminate WABA
  • 2.1: Create New Tree
  • 2.2: Build the First Node
  • 2.3: Create a Global Node
  • 2.4: Build Child Nodes
  • 2.5: Connect to Datasource
  • 3.1: Create Priority Group
  • 4.1: Create Product Message

Common Use Case Application

  • Overview
  • 1.1: Apply Fail-Safe to Chatbot
  • 1.2: Apply Member Unsubscription Flow to Chatbot

Advanced Chatbot Application

  • Overview
  • Apply Datasource to Chatbot
  • Apply Payload Value to Chatbot
  • Apply API to Chatbot
  • Apply Custom Locale to Chatbot
  • Apply Opt-in Flow to Chatbot
  • Apply Agenda to Chatbot
  • Apply Stella API to Chatbot
  • Apply Web Event to Webchat Chatbot

Error Handling

  • Handle Errors for Chatbot

Stella Partner Portal Setup

  • Overview
  • 1.1: Partner Portal Setup
  • 1.2: New Customer Onboarding
  • 1.3: WABA Setup
  • 1.4: Check Approval Status of WABA
  • 1.5: Setup WABA with Used WhatsApp Number
  • 1.6: Reset / Terminate WABA

Template Tree

  • Overview
  • Create Template Tree
  • Manage Proxy Tree

Chatbot Testing & Deployment

  • Overview
  • Stage One - Tree Building
  • Stage Two - Testing Stage
  • Stage Three - Production Deployment

Slack Live Chat Tree Setup

  • Overview
  • 1.1: Create Tree for Live Chat Assignment
  • 2.1: Set Up Pick Ticket Status
  • 2.2: Create Done Command
  • 2.3: Create Transfer Command
  • 2.4: Create Archive Function
  • 2.5: Create Member Tagging/Remarks Command
  • 3.1: Automatic End Live Chat Function

Zendesk Live Chat Tree Setup

  • Overview
  • 1.1: Create Tree for Assignment
  • 2.1: Create Done Command
  • 2.2: Auto End Live Chat Function

FAQ Chatbot Setup

  • Overview
  • 1.1: Exact Keyword Match
  • 1.2: Keyword Groups Match & Diversion
  • 2.1: Redirect to Existing Chatbot Tree
  • 2.2: Data Analytics for FAQ Chatbot
  • 2.3: NLP for FAQ Chatbot
  • 3.1: Filtering Questions for FAQ Chatbot

NLP Chatbot Setup

  • Overview
  • 1.1: Apply NLP to your Chatbot
  • 2.1: Set Up an NLP Fallback Tree
  • 3.1: NLP Fallback to Other Languages

Connect Shopify Store to Stella

  • Overview
  • 1.1: Integrate Stella to Shopify
  • 2.1: Setup Facebook Messenger Chatbot for Shopify
  • 2.2: Setup WhatsApp Chatbot for Shopify
  • 2.3: WhatsApp Customer Care Notification for Shopify

Stella Inbox Setup

  • Overview
  • 1.1: Connect Channel to Slack
  • 1.2: Access Control & Admin Panel
  • 1.3: Set up Customizable Message
  • 1.4: Inbox Channel
  • 2.1: Turn on Live Chat Directly
  • 2.2: End Live Chat Mode
  • 2.3: Ticketing
  • 2.4: Manage Ticket Helper
  • 2.5: Add Member Tag
  • 3.1: Send Chatbot Message

Create Transfer Command

You can transfer your live chat to another team by simply typing a transfer command.

This is particular useful if a customer is asking questions that are not under your specialty and must escalate to another team for follow up.

Please set up this command in the Slack Command Tree you've created in 2.1.


What is your Result?

First, the customer requests another team handle this enquiry. Then, the agent types @[bot]transfer to choose which team to be transferred to.

Second, the agent chooses which teams to be transferred (i.e. Business Team) and ends the original live chat.

Third, the channel, to which the agent has made the transfer, receives the newly transferred ticket.

New Transferred Ticket on the Transferred Channel
  • Please remember to connect your Slack Channel on Stella before testing for the result.

Sample Tree Structure for Transfer Command

Slack Command Tree Structure for Transfer Command

You can click here to download the sample tree.


Getting Hands-on

Click here to build your tree.

Create Tree Node - Transfer Command

  1. Create the 1st tree node and name it as "Transfer Command". Then, you can set up the message when chatbots asks the agent to select the follow-up team for ticket transfer. Input the following code in the pre-action :
return new Promise(async (resolve, reject) => {
  try {
    let labelArray = [
      {
        name: "Business Team",
        label: "biz"
      },
      {
        name: "Dev Team",
        label: "dev"
      },
    ]
    let group
    if (this.channel.exclusiveLiveChat === false) {
      group = await this.getGroupByExternalId({
        groupId: this.messageEvent.to,
        type: this.channel.type,
        channelId: this.channel._id,
      })
    } else {
      group = await this.getGroupByExternalId({
        adminExternalId: this.messageEvent.from,
        groupId: this.messageEvent.to,
        type: this.channel.type,
        channelId: this.channel._id,
      })
    }

    if (group.active === false) {
      resolve()
    } else {
      let buttons = this.lodash.map(labelArray, (label) => {
        return {
          type: "postback",
          title: label.name,
          payload: {
            payload: "SELECT_TRANSFER_GROUP",
            value: label.label
          }
        }
      })
      await this.sendMessageToOutletGroup({
        group,
        response: {
          type: "BUTTON",
          text: "Which team would you like to transfer this ticket to?",
          buttons,
        },
      })
      resolve()
    }
  } catch (e) {
    reject(e)
  }
})

The array of labels refer to the available follow-up channels that can receive transferred tickets. You may change the button name for each team on the field "Name". It can be set up/found in Broadcast Group

You may also change the message on the field "text" under "response".

Create Tree Node - Select Group

  1. Create a 2nd tree node and name it as "Select Group".

  2. In the following section, you will create the 3 actions. Please follow the steps of the procedure and put these actions under pre-action of this node with the exact order

  3. Create the 1st action for sending the transfer message to inlet with the following code:

return new Promise(async (resolve, reject) => {
  try {
    let group
    if (this.channel.exclusiveLiveChat === false) {
      group = await this.getGroupByExternalId({
        groupId: this.messageEvent.to,
        type: this.channel.type,
        channelId: this.channel._id,
      })
    } else {
      group = await this.getGroupByExternalId({
        adminExternalId: this.messageEvent.from,
        groupId: this.messageEvent.to,
        type: this.channel.type,
        channelId: this.channel._id,
      })
    }

    const member = await this.getMember({ memberId: group.member })
    let response
    if (/zh/g.test(this.lodash.get(member, "locale", ""))) {
      response = {
        type: "TEXT",
        text: "請稍等,我們正安排另一位專員處理您的查詢。"
      }
    } else {
      response = {
        type: "TEXT",
        text: "Please wait for a moment, our representative will take over your chat soon."
      }
    }
      
    await this.sendMessageToInlet({
      messageEvent: this.messageEvent,
      channel: this.channel,
      response,
    })
    console.log("sending message to inlet")
    this.member.group = group
    this.member.inletMember = member
    resolve({
      member: this.member
    })
  } catch (e) {
    reject(e)
  }
})

You may feel free to change the message on the field of "text" under "response" to fit your tone & manner.

  1. Create the 2nd action for creating the transferred assignment to the new team with the following code:
return new Promise(async (resolve, reject) => {
  try {
    const assignment = await this.getAssignment({ assignmentId: this.member.group.assignment })
    console.log("assignment", assignment)
    let member = this.member.inletMember
    let labelArray = [
      {
        name: "Business Team",
        label: "biz"
      },
      {
        name: "Dev Team",
        label: "dev"
      }
    ]
    let oldLabel = this.lodash.find(labelArray, { label: assignment.label })
    if (!oldLabel) {
      oldLabel = {
        name: "General",
        value: "general"
      }
    }
    let newLabel = this.lodash.find(labelArray, { label: this.messageEvent.data.payload.value })
    let relayMessage = assignment.relayMessage
    let summary = ""
    let relayText
    if (/zh/g.test(this.lodash.get(member, "locale", ""))) {
      relayText = `${this.member.firstName} ${this.member.lastName} has transferred ${member.firstName} ${member.lastName} to ${newLabel.name}\n${this.moment().format("YYYY-MM-DD")}`
      summary = `姓名: ${member.firstName} ${member.lastName}\n此查詢由 ${oldLabel.name} 轉移到 ${newLabel.name}\n請按以下連結開啟對話紀錄:`
    } else {
      summary = `Name: ${member.firstName} ${member.lastName}\nThis ticket is transferred from ${oldLabel.name} to ${newLabel.name}\nPlease view conversation history at:`
      relayText = `${this.member.firstName} ${this.member.lastName} has transferred ${member.firstName} ${member.lastName} to ${newLabel.name}\n${this.moment().format("YYYY-MM-DD")}`
    }
    relayMessage.slack.text = relayText
    console.log("reassigning")
    await this.reassignAssignment({
      messageEvent: this.messageEvent,
      channel: this.channel,
      label: this.messageEvent.data.payload.value,
      relayMessage,
      summary,
    })
    console.log("reassigned message sent")
    resolve()
  } catch (e) {
    reject(e)
  }
})

You may feel free to change the following section to fit your tone & manner:

  • summary
  • relayText
  • You may edit the label according to your set up in Broadcast Group
  1. Create the 3rd action for sending the transfer status to notify the agent who initiated the transfer with the following code:
return new Promise(async (resolve, reject) => {
  try {
    console.log("in send transfer successful to group")
    console.log("group", this.member.group)
    await this.sendMessageToOutletGroup({
      group: this.member.group,
      responseUrl: this.messageEvent.response_url,
      response: {
        type: "ATTACHMENT",
        text: this.messageEvent.data.originalMessage.text.replace(/\+/g, " "),
        attachments: [
          {
            text: "Transferred",
            fallback: "Transferred",
            color: "#36a64f"
          }
        ],
        replaceOriginal: true
      }
    })
    resolve()
  } catch (e) {
    reject(e)
  }
})
  1. Finally, create 2 responses in Advanced > Response Object with the following code:

The first response:

{
  "type": "TEXT",
  "text": "Your Transfer command has successfully sent. Thanks!"
}

The second response (this will only be activated once you have completed step 2.4):

{
  "type": "BUTTON",
  "buttons": [
    {
      "type": "postback",
      "payload": "ARCHIVE",
      "title": "Archive Now"
    }
  ],
  "text": "Do you want to archive this channel now?"
}

Create a Global Node - Transfer Command Global

  1. Create a global node and name it as "Transfer Command GLobal". Then, create a trigger with two conditions with the and operator:

Transfer Command Trigger for Slack

First condition - at bot:

new RegExp(`<@${this.channel.info.botId}`).test(this.messageEvent.data.text)

Second condition - regex transfer:

/transfer/i.test(this.messageEvent.data.text)
  1. Toggle Redirect to the "Transfer Command" tree node.

Redirect to Slack Transfer Command Tree Node

Create a Global Node - Select Group Global

  1. Create a global node and name it as "Select Group Global". Then, create a trigger with two conditions with the and operator:

Select Team Button Trigger for Slack

First condition - SELECT_TRANSFER_GROUP

this.lodash.get(this.messageEvent, "data.payload.payload") === "SELECT_TRANSFER_GROUP"

Second condition - Type Payload

this.messageEvent.type === "PAYLOAD"
  1. Toggle Redirect to the "Select Group" tree node.

Redirect to Select Group Tree Node

Before testing, please remember to update the tree and global node in the Slack Channel.

  1. Check and see if you can produce the expected outcome.
← 2.2: Create Done Command2.4: Create Archive Function →
  • What is your Result?
  • Sample Tree Structure for Transfer Command
  • Getting Hands-on
    • Create Tree Node - Transfer Command
    • Create Tree Node - Select Group
    • Create a Global Node - Transfer Command Global
    • Create a Global Node - Select Group Global
Stella Platform Documentation
Docs
Get StartedBot API ReferenceAPI ReferenceStandard Procedures
Community
FAQUser ShowcaseChat with Us
Copyright © 2023 Sanuker Inc. Limited