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

Open comments for this post

32m 19s logged

Devlog 01: My First Slack Bot 🎉

ok so this is my first time actually making a slack bot and honestly i didnt expect it to work lol

built it with slack bolt in socket mode. picked socket mode bc i didnt wanna deal with hosting a public url just to test stuff locally. that made it way less painful tbh

started with just one command /dsb-darsh-ping that tells you the latency. seeing it reply in slack the first time was kinda hype so i ended up adding more:

  • /dsb-darsh-ping – latency check
  • /dsb-darsh-help – lists the commands
  • /dsb-darsh-catfact – random cat fact from an api
  • /dsb-darsh-joke – random joke

the api ones were the fun part. you basically ack() the command first (you only get like 3 sec, found that out the annoying way), then fetch with axios and throw it in a try/catch so the whole thing doesnt die if the api is down

also wasted a solid 10 min confused why /dsb-ping wouldnt register… turns out someone in the workspace already used that name and they have to be unique. so i just slapped dsb-darsh- in front of all of mine. also moved my tokens into a .env so i dont accidentally push them to github

anyway small thing but learned a lot.

0
66

Comments 0

No comments yet. Be the first!