Bot

Added reminders to our Matrix bot

By John Locke on May 22, 2017

!remind me to respond to Bill in 2 hours

For the past year, our Watney bot has alerted the release manager at the time scheduled by a project manager, so they can trigger a deployment. Today we generalized that reminder functionality so that any of us can add an arbitrary reminder that the bot will play back to us in the future.

This is very convenient because I can now easily add a reminder from my phone, or any o !remind me to respond to Bill... f my computers, and it will chime and send me a message at the designated time. Furthermore, we can use it in any of our project rooms, and specify somebody else to notify.

Watney is written in Javascript, and uses the matrix-js-sdk library to interact with Matrix. For this reminder functionality, we leveraged the easypattern, sugar, and node-schedule modules from npm, and borrowed a lot of the parsing from the unmaintained zeke/remind-me module.

What's unusual about Watney is that it uses Matrix rooms themselves to store all of its data -- it has no other database. Matrix allows you to store arbitrary state events in each room. Watney stores an object listing all the reminders for a room in the room state, in addition to keeping them in RAM using node-schedule. When Watney restarts, it reloads each future reminder into node-schedule. When reminders trigger, it updates the state with the remaining future reminders.

Topic

Add new comment

The content of this field is kept private and will not be shown publicly.

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <blockquote cite> <cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h1> <h2 id> <h3 id> <h4 id> <h5 id> <p> <br> <img src alt height width>
  • Lines and paragraphs break automatically.

Drupal Canvas — Block HTML (locked)

  • Allowed HTML tags: <strong> <em> <u> <a href> <p> <br> <ul> <ol> <li>

Drupal Canvas — Inline HTML (locked)

  • Allowed HTML tags: <strong> <em> <u> <a href>

More Like This

🕑Sep 17, 2017 🖋John Locke 💬0

Post Salt events into a Matrix room

In our quest to get all things into Matrix, we've also sent Salt events into a Matrix room. This is extremely useful to monitor the results of automatic highstate runs, individual commands, etc.

Matrix
🕑Dec 06, 2016 🖋John Locke 💬12

Yet another messaging platform: Why Riot?

People who know me know I can get stubborn when I get sold on a particular technology. For the past year, my favorite is Matrix, a distributed chat system that addresses pretty much everything anyone wants from a messaging system. The only catch? Not that many "regular people" are using it yet.

🕑Sep 12, 2016 🖋John Locke 💬0

The Permanent Web

September 2016

[Update: a few days after I published this, Vector.im rebranded as Riot.im. It's the same project, just a new name...]

In 5,000 years, will anybody be able to read (or even access) things we put online today? Here at the dawn of the information age, we are creating the archetypes that have big implications, possibly for thousands of years. There's a bunch of recent science fiction stories that imagine various futures, written with the perspective of today's web, extrapolating where things might go as humanity evolves.