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

My first slack bot!

  • 2 Devlogs
  • 1 Total hours

This bot isn't slacking off, it replies to messages 24/7!

Ship #2 Changes requested

shipped always-on bot, a slack bot that never clocks out. you slash it a command and it fires back a joke, a dice roll, a live cat fact, or an 8-ball verdict. i wrote it in javascript on @slack/bolt in socket mode, so it connects over an outbound websocket and skips the public-url handshake. the reply logic sits in one file as plain text-in, text-out functions with no slack code, which lets me unit-test the whole brain without a workspace (15 tests pass). it runs on hack club nest as a systemd service that restarts on crash and boots on startup, and it's held a live connection for over a day. i gave it a status page and a health endpoint too, so there's a url that proves it's awake.

  • 1 devlog
  • 0h
Try project → See source code →
Open comments for this post

16m 52s logged

shipped always-on bot, a slack bot that never clocks out. you slash it a command and it fires back a joke, a dice roll, a live cat fact, or an 8-ball verdict. i wrote it in javascript on @slack/bolt in socket mode, so it connects over an outbound websocket and skips the public-url handshake. the reply logic sits in one file as plain text-in, text-out functions with no slack code, which lets me unit-test the whole brain without a workspace (15 tests pass). it runs on hack club nest as a systemd service that restarts on crash and boots on startup, and it’s held a live connection for over a day. i gave it a status page and a health endpoint too, so there’s a url that proves it’s awake.

0
0
1
Ship #1 Changes requested

Always-On Slack Bot — shipped and running 24/7
Wanted to build a Slack bot that never goes offline and just answers whatever you throw at it. Got it done this week.
I used JavaScript with Slack's Bolt framework in Socket Mode, so the bot talks to Slack over a WebSocket instead of needing a public URL. It has 10 slash commands so far: /ao-help, /ao-joke, /ao-quote, a magic 8-ball, a coin flip, a dice roller, /ao-time, and /ao-catfact which pulls a random fact from a live API. I kept all the reply logic in its own file with zero Slack code in it, which let me write real unit tests for it (15 of them, all passing).
The part I'm happiest with is the hosting. Rather than a free web host that falls asleep after a few minutes, I put it on Hack Club Nest as a systemd service. It auto-restarts if it crashes and comes back up on reboot, so it's genuinely online around the clock. I also gave it a small status page so there's a link you can actually open: https://bot.akshajdewan102.hackclub.app
Things I learned the hard way: Nest containers are just plain Debian, so I had to apt install node and git myself before anything would run, and Socket Mode needs two separate tokens (a bot token and an app-level token) which took me a minute to figure out.
Next up: a few more commands, and maybe a small database if I want it to remember anything between messages.

Try project → See source code →
Open comments for this post

23m 51s logged

Always-On Slack Bot — shipped and running 24/7Wanted to build a Slack bot that never goes offline and just answers whatever you throw at it. Got it done this week.I used JavaScript with Slack’s Bolt framework in Socket Mode, so the bot talks to Slack over a WebSocket instead of needing a public URL. It has 10 slash commands so far: /ao-help, /ao-joke, /ao-quote, a magic 8-ball, a coin flip, a dice roller, /ao-time, and /ao-catfact which pulls a random fact from a live API. I kept all the reply logic in its own file with zero Slack code in it, which let me write real unit tests for it (15 of them, all passing).The part I’m happiest with is the hosting. Rather than a free web host that falls asleep after a few minutes, I put it on Hack Club Nest as a systemd service. It auto-restarts if it crashes and comes back up on reboot, so it’s genuinely online around the clock. I also gave it a small status page so there’s a link you can actually open: https://bot.akshajdewan102.hackclub.appThings I learned the hard way: Nest containers are just plain Debian, so I had to apt install node and git myself before anything would run, and Socket Mode needs two separate tokens (a bot token and an app-level token) which took me a minute to figure out.Next up: a few more commands, and maybe a small database if I want it to remember anything between messages.

0
0
14

Followers

Loading…