Dev Log: Setting up a Slack Bot that Runs 24/7
What I’ve Built: Slack bot in Node.js using @slack/bolt module, deployed and kept running on my Hack Club Nest Linux server.
How I Did It:
Setting Up: Set up my bot in the Slack API using Socket Mode and generated my tokens.
Connecting to Server: SSH’ed into my Nest server. Initially ran into timeout issue with IPv4 IP, but was able to connect through my public IPv6 IP.
The Blocker: Installed Git and Node.js on my server, then cloned my repo. My npm install command was unsuccessful since I hadn’t pushed my package.json file. Quickly fixed this by adding the package.json file through GitHub UI and running git pull on the server.
Going 24/7: Manually created my .env file in the server. To keep my bot running even when I close my computer, I created my own systemd background service (slackbot.service) for the node process.
Result: Success!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.