This is a rough transcript along with the slides from our SIGNAL 2016 talk from May 24, 2016.
You can also find the slides without notes on my tech talks page. The code for the bot is open sourced under the MIT license in a GitHub repository named callbot.
At the end of the talk I give out bot-building resources to all the attendees - all those linked resources are listed at the bottom of this post.
R2-D2 or Skynet? Combining Slack Bots with the Twilio API by Matt Makai (Twilio) and Don Goodman-Wilson (Slack)
Hey folks, my name is Matt Makai and I'm a Developer Evangelist with Twilio. Joining me on stage is Don Goodman-Wilson, a Senior Developer Advocate from Slack. Welcome to "R2-D2 or Skynet?" Today we're going to show how to combine the Slack and Twilio APIs and learn about good bot-building practices.
Back in March, Twilio launched Tutorials, a new feature on the Twilio documentation. If you're a developer working on common features that incorporate Twilio, such as two-factor authentication or building an interactive voice response (IVR) system, you could find a tutorial with the code in your programming language along with an entire step-by-step walkthrough for how to add that feature to your application.
The launch involved about a dozen people at Twilio within the Developer Network team. Even with a reasonable size team we ran into issues manually scaling our communication across everyone on the team, such as when blog posts were going live.
Twilio's mission is to empower developers to build the future of communications. Internally, we use many tools to help us accomplish that mission.
One of those tools is Slack, which Twilio uses company-wide. A new Slack channel was born with everyone who was on point for the launch.
Slack's mission is to make people's working lives simpler, more pleasant and more productive.
During our tutorials launch, we faced scaling challenges that we might've been able to overcome if we had better automated communication.
There is definitely a better way to handle all these logistics. The answer is spreadsheets. Lots and lots of spreadsheets.
No, not really spreadsheets. We're software developers. We're on the side of good - the ones that want to rid the world of spreadsheets, not make them proliferate.
Our Slackbot should start out friendly, with helpful nudges like R2-D2's bleeps and boops.
...but the bot goes full Skynet mode if you just never respond.
What we could use are smart bots in Slack with some intelligence based on our launch schedule and the list of people involved.
How would this Slack Bot scheduling utopia work? Well, rather than just talk about it, let's launch something together right now.
Here are the three items part of our launch today: open source a GitHub project named "callbot", publish a Twilio blog post and social promote with @twilio.
We need a Slack channel to coordinate our launch, so we created one at draw-the-owl-bot.slack.com. Now we need your help. Get out your phones. Join the channel by texting (415) 689-xxxx.
Our demo assistant is "Draw the Owl Bot", after one of Twilio's core values named after the Draw the Owl Bot meme.
Here's how our bot architecture works. When you sent a text message to our Slack bot's phone number, that was actually a number on Twilio. Twilio then sent an HTTP POST request to the Draw the Owl Bot and it responded with TwiML. Draw the Owl Bot then made a call to the Slack API to post a message.
The Slack API is a very important part of the architecture, so here's more context about it.
The Slack web API has a couple of methods that we're using in our talk today.
Here are some important points about the Slack Real Time Messaging API.
Let's finally get to the launch! (Demo done in Slack console.)
The demo architecture was a bit different than when people texted in the first time. In this case, we're going from the Slack user interface via their web app, with outbound communication to phones.
Here are several rules for building great bots based on what Slack's seen so far with their API.
For every interaction, ask yourself if it's necessary and makes people's lives better and their jobs easier.
Thanks for launching with us! Let's quickly see how we're doing on our GitHub stars and retweets.
To paraphrase Jeff Lawson, our CEO and co-founder, we can't wait to see what bots you build.
Thanks again! My name is Matt Makai and I'm a Developer Evangelist with Twilio, this is Don Goodman-Wilson from Slack. We'll be happy to answer questions in the hallway or contact us with the information on this slide.
Resources given out via SMS during this talk provided below.