O'Reilly logo

Building Slack Bots by Paul Asjes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Using Data

Now that we've seen how to process keywords, commands, and API calls, we will look at the next logical step in bot building: persistent data storage and retrieval. References to data can be kept in JavaScript by assigning said data to a variable; however, its use is limited to when the program is running. If the program is stopped or restarted, we lose the data. Hence, persistent data storage is required for certain tasks.

This allows us to build bots that can, for instance, keep track of a leaderboard or store a to-do list.

In this chapter, we will cover:

  • Introduction to Redis
  • Connecting to Redis
  • Saving and retrieving data
  • Best practices
  • Error handling

Introduction to Redis

In the previous chapter, we discovered how to create a competitive ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required