Chapter 2. Your First Bot

Readers will be amazed at how few lines of code are required to get a basic bot up and running in their Slack environment. This chapter will walk the reader through the basics of building a Slack bot:

  • Preparing your environment
  • Creating a Slack API token
  • Connecting your bot
  • Joining a channel
  • Sending a message to a channel
  • Basic responses
  • Sending a direct message
  • Restricting access
  • Debugging your bot

Although some of the concepts first outlined will be known to a more advanced reader, it is still recommended to read through the first few sections of this chapter to ensure that your environment is up and ready to go.

In this chapter, we will build a bot that performs the following actions:

  • Connects to your Slack team
  • Says hello to all ...

Get Building Slack Bots now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.