You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

48m 20s logged

Today I worked on my Slack bot and got it running 24/7 with systemd.

The bot currently has several slash commands, including ping, cat facts, jokes, coin flips, dice rolls, random choices, quotes, Magic 8 Ball answers, and help. I also started adding a new /pp-pi command that lets users request digits of pi from 0 to 500.

I ran into an issue where /pp-pi existed in Slack, but the app kept saying it did not respond. After debugging, I realized the server version of index.js did not actually have the new /pp-pi handler yet. The bot was still running the older code, so Slack was sending the command but Node had nothing to respond with.

I learned that when a bot is running through systemd, editing code locally does not automatically update the hosted version. The server needs to pull the latest code from GitHub and restart the service.

Next, I’m setting up a simple update workflow:

  • edit locally
  • commit and push to GitHub
  • pull on the server
  • restart the Slack bot service

This should make it much easier to keep adding new commands without manually editing files on the server every time.

0
11

Comments 0

No comments yet. Be the first!