Nova’s personal Slack bot, for my personal channels on the Hack Club Slack.
It has many features, such as automatic threaded messages, thread ping warnings, a command to join a private channel, and advanced daily recaps that integrate with APIs! :3
Nova’s personal Slack bot, for my personal channels on the Hack Club Slack.
It has many features, such as automatic threaded messages, thread ping warnings, a command to join a private channel, and advanced daily recaps that integrate with APIs! :3
I created a Slack bot for my personal channels in the Hack Club Slack! This was my first ever Slack bot, and creating it was challenging. I had to work with regex and work around the Slack API’s limitations to make this possible. I also used Docker to host it, Zod for config validation, and many other things that required hard work to solve. Daily recaps were especially great, as I integrated them with a previous project of mine (Universal Status) for pulling my current status.
There are instructions for testing all of the features in the #novabot-playground channel :3
I finally finished the bot! I also added a few new features.
I cleaned up the README and made some improvements! I added more instructions, clarified some things, and added some extras (like the Not by AI badge)
The bot now has a config option to automatically approve requests to join
There were some various errors in different parts of the code, as well as things like ESLint not working properly. I fixed these! I also fixed a config permissions issue.
I restructured the code to be in a /src directory, as that makes it easier for me to normalize paths and work with TypeScript compilation.
I added GitHub Actions workflows for building and linting the code. This was a bit complicated, as I had to work around pnpm and Docker Buildx (I’m running this on a Raspberry Pi 5, so I have to build for both x86_64 and ARM64).
The bot is finally ready to ship, so that’s my next step! :3
Log in to leave a comment
I added a Dockerfile and configuration system, as well as many improvements to the README!
There is now a config system! This makes it easy to change things, such as the time daily recaps trigger and what channel is used. It uses Zod for validation, and I migrated most of the hardcoded values to config ones.
I wrote most of the README.md file, including a very detailed features list and some deployment instructions. It isn’t done, but I still added a lot to it.
I added a Dockerfile for running the app in Docker! It’s fairly simple, but it should work properly!
Log in to leave a comment
I did a few things during this time! One thing is I slimmed the code down quite a bit, and removed some duplicated code (like how I was fully replacing blocks on messages before, instead of just re-using the existing blocks like I do now). I also improved some error handling and code structure!
Some other things:
There’s now a command to join my tier 2 channel! This replaces what I used to use a workflow for, but workflows are sadly gone from the Hack Club Slack now.
This is also better than the workflow approach, as it sends DMs on approval/rejection and has the ability to reject users. It’s also just generally more custom and better.
This integrates with a previous project of mine, Universal Status, to show my current status in my daily recaps. It’s just a fun little thing, and I plan to add more of these to the private recap soon!
Now, the recap message links to my recap directly in the private channel, instead of the bot’s message. This allows people to read the public recap directly from my private channel. If I don’t have any messages in the thread, it will fallback to the bot message (because error handling)! It also has some extra checks, like it will only look at messages from my user ID (since sometimes people type in recap threads while they wait for me to post a recap).
Log in to leave a comment
I added daily recaps to the bot! There are two kinds:
These are in my public channel, and they are just standard recaps of my day. They are meant to use bullet-pointed lists, and this message is scheduled to send at 10:30 PM every night. It includes a button to mark it as done, which is used for the next kind of recaps! These buttons also have proper permission checks using my Slack user ID.
These are for my private channel, generally used for more detailed recap info that I don’t feel comfortable sharing publicly, or photos of myself. These are triggered by clicking the done button on a public recap, and they include a link to the public recap.
Both kinds of recaps have single-click “done” buttons, as well as reactions (the bot reacts with the 💤 emoji on message send, then changes to ✨ after the recap is marked done, as a way to indicate to people looking at the recap message).
Recaps are mostly done, and scheduling them works, but I still need to improve some things with them. I also want to add more details to private recaps, likely some of which will be pulled from my previously made Discord bot!
Log in to leave a comment
I started building the bot! I’m using Slack’s Bolt library for NodeJS, and I have gotten a fairly functional development setup. I built it to work in either socket or HTTP mode without any changes to the code (just environment variables).
I also added a feature that yells at people for threading on a user group mention! This uses an ephemeral message so that people will hopefully reply on the part that doesn’t ping people for every message. For now, it only detects when the top-level message is a user group mention, not when a user group is mentioned in the thread (though this may change).
I have had to write regex and get around TypeScript problems in this time, and it’s fairly complicated since I’m trying to not use any AI in the process of making this bot.
Log in to leave a comment