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 ...

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.