Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Building Slack Bots

You're reading from  Building Slack Bots

Product type Book
Published in Jun 2016
Publisher Packt
ISBN-13 9781786460806
Pages 182 pages
Edition 1st Edition
Languages
Concepts

Chapter 1. Getting Started with Slack

This book will enable a beginner to create their own Slack bot either for amusement or professional purposes.

The ultimate goal of this book is for you to think of Slack as a development platform with great potential, rather than simply a chat client. As Slack continues its meteoric rise in popularity in the developer community, the possibilities and opportunities contained in Slack apps will prove to be a valuable tool in any developer's toolbox.

In this chapter, we introduce you to Slack and its possibilities. We will cover:

  • An introduction to Slack

  • Slack as a platform

  • The end goal

Introduction to Slack


Launched in August 2013, Slack started as an internal communication tool utilized by small teams but has been rapidly morphing into a versatile communications platform used by many parties, including the open source community and large businesses.

Slack is a real-time messaging application that specializes in team communication. In a crowded space of productivity applications, Slack sets itself apart by providing extensive integrations with popular third-party apps and provides users with the platform to build their own integrations.

As of the beginning of 2016, Slack is used by approximately 2 million users daily, and spread across 60,000 teams that send 800 million messages per month (http://expandedramblings.com/index.php/slack-statistics/). Some of the more well known companies who use Slack include Airbnb, LinkedIn, and The New York Times. This service has become so popular, largely thanks to its impressive uptime rate of over 99.9 percent. What sets Slack apart from competition such as HipChat or Skype for Business is the determination of the company to open its platform for third-party developers in the form of an application program interface (API). To spur the growth of their service as a platform, in December 2015 Slack pledged to invest $80 million into software projects that use its technology (http://fortune.com/2015/12/15/slack-app-investment-fund/). Added to the more than $320 million raised in funding for the company, it's safe to say that Slack will continue to be a driving force in the team productivity space in the years to come.

Slack as a platform


What many users perhaps don't know about Slack is that underneath the messaging client, a highly extensible platform exists that can be used to create apps and business tools that can simplify the development cycle, perform complex tasks, or just be downright silly.

Slack's UI with its own Slack bot in action

This platform or API can be utilized to integrate third-party services into Slack's platform and leverage their extensive reach and user friendly interface. The said third-party applications can send data into Slack via incoming webhooks, execute actions outside of Slack with commands, or respond to commands as a bot user. The bot user or bot is the most interesting; they are so named as they can mimic human users by performing the same actions that any human can.

Note

Slack bots are software applications that run on the Slack Real Time Messaging (RTM) platform. Bots can be used to interact with external applications or your custom code in a conversational manner.

Some of the more popular bots include GitHub's multitasking Hubot (https://hubot.github.com/) and Meekan's scheduling bot (http://meekan.com/slack/), but many more of varying complexity are developed each day.

The most obvious and well known bot is Slack's own Slack bot, used for built-in Slack functions such as:

  • Sending feedback to Slack

  • Scheduling reminders

  • Printing a list of all users in a channel

Another widely popular bot is Hubot. Originally developed by GitHub and ported to Slack by Slack themselves, Hubot can provide useful functionality such as GitHub activity tracking, which can keep you up to date with GitHub repositories.

GitHub integration showing branch and pull request activity

You can also add infrastructure monitoring through Jenkins:

Jenkins integration bot showing build automation logs in Slack

Bots can transform Slack from a simple messaging client to an important business tool, benefitting any company that uses custom bots unique to their workflow. The beauty of the Slack platform is that anyone can create a functional bot in a few simple steps.

The end goal


Upon completing this book, the reader will be able to build a complex Slack bot that can perform the following tasks, amongst other things:

  • Receive and send message sent in Slack

  • Respond to user commands

  • Process natural language

  • Perform useful tasks on command (for example, fetch data from external sources)

  • Insert custom data into Slack via webhooks and slash commands

Summary


This chapter gave you an overview on what Slack is, why it is noteworthy, and how its platform can be leveraged to create a myriad of useful apps. The next chapter will show you how to build your first simple Slack bot.

You have been reading a chapter from
Building Slack Bots
Published in: Jun 2016 Publisher: Packt ISBN-13: 9781786460806
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}