How to build a scalable Slack chatbot: Find out best practices for chatbots user experience and how to build these bots using GCP serverless technologies.
4. @girlie_mac
What are Bots?
A bot is a software application that runs
automated tasks (scripts).
Typically, bots perform tasks that are
both simple and structurally repetitive,
at a much higher rate than would be
possible for a human alone.
5. @girlie_mac
What are Bots?
Bots also are a user experience that can
expose products and services to users
through conversational engagement
and rich interactions.
11. @girlie_mac
The example payload sent to the configured external URL via HTTP POST:
token=gIkuvaNzQIHg97ATvDxqgjtO
team_id=T0001
team_domain=example
channel_id=C2147483705
channel_name=general
user_id=U2147483697
user_name=bob
command=/weather
text=94901
response_url=https://hooks.slack.com/commands/1234/5678
trigger_id=13345224609.738474920.8088930838d88f008e0
Slash commands
12. @girlie_mac
Send back a plain text or JSON response with HTTP 200 “OK”:
{
"text": "It's 80 degrees right now.",
"attachments": [
{
"text": "Partly cloudy today and tomorrow"
}
]
}
Slash commands
13. @girlie_mac
★ Name the command thoughtfully
★ Avoid a generic command e.g. /find
★ Format the results
★ Even if no reply is posted back,
respond w/ HTTP 200
Slash Command Best Practice
21. @girlie_mac
Conversations
Listening to events
"event": {
"type": "message",
"channel": "C2147483705",
"user": "U2147483697",
"text": "Hello world",
"ts": "1355517523.000005"
}
If your bot sees trigger words, send back a message with
chat.postMessage
22. @girlie_mac
★ Let users know how the bot works w/
thoughtful onboarding / guide
★ Support keywords like help
★ Combine w/ rich interactions like
buttons
Conversational Bots Best Practice
26. @girlie_mac
Bot Interactions Summary
Slash commands - Send results on user’s demand
Notifications - Send reports or alerts into a conversation
Bot conversations - Facilitate short workflows
Rich interactions - Augmenting all of these with actionable
buttons, menus, dialogs, etc.
34. @girlie_mac
What is NLP?
Process and analyze natural language data to make the interactions
between computers and human (natural) languages possible