A Slack bot I built with Bun, TypeScript, and Slack Bolt. It runs entirely through Socket Mode, so you don't need to expose a public server just to test or use it.
I mainly built this as a fun project to explore Slack's API while keeping the codebase clean, strongly typed, and easy to extend.
Live demo: https://tadstech.github.io/SlackBot
Right now the bot comes with 25 slash commands split into five groups:
- Utility
- Fun
- Knowledge
- Media
- Random
Some commands are simple quality-of-life tools like ping, uptime, and echo. Others pull data from free public APIs for things like:
- jokes
- quotes
- trivia
- weather
- cryptocurrency prices
- dictionary definitions
- random facts
- dog images
- cat facts
- and a few more
Most responses have multiple variants so the bot doesn't repeat the exact same message every time.
Since everything runs through Socket Mode, there's no Request URL to host or tunnel during development.
| Category | Commands |
|---|---|
| Utility | /toc-ping, /toc-help, /toc-echo, /toc-time, /toc-uptime |
| Fun | /toc-joke, /toc-roast, /toc-8ball, /toc-wyr, /toc-bored, /toc-kanye |
| Knowledge | /toc-fact, /toc-quote, /toc-define, /toc-number, /toc-trivia |
| Media | /toc-cat, /toc-dog, /toc-weather, /toc-crypto |
| Random | /toc-court, /toc-fortune, /toc-corporate, /toc-therapy, /toc-plot |
- Bun
- TypeScript (strict mode)
- Slack Bolt
- Axios
- ESLint
- Prettier
- Husky
- lint-staged
Nothing too fancy—just tools that make development smoother.
Clone the repository:
git clone https://github.com/TADSTech/SlackBot.git
cd SlackBot
bun installCreate a Slack app, enable Socket Mode, then add the required scopes:
chat:writecommands
Copy the environment template:
cp .env.example .envFill it in:
SLACK_BOT_TOKEN=xoxb-your-token
SLACK_APP_TOKEN=xapp-your-tokenThen create the slash commands in your Slack app using the names listed above.
Since this uses Socket Mode, you don't need a Request URL.
Run the bot:
bun run index.tsThat's it.
SlackBot/
├── index.ts
├── frontend/
├── .husky/
├── commands.txt
├── tsconfig.json
├── eslint.config.js
├── .prettierrc
└── package.json
The project intentionally stays pretty small. Most of the logic lives in index.ts, making it easy to add new commands without digging through a huge folder structure.
bun run index.ts # Start the bot
bun run lint # Lint
bun run lint:fix # Auto-fix lint issues
bun run format # Format everything
bun run format:check # Check formatting
bun run typecheck # TypeScript checks
bun run check # Run all checksA Husky pre-push hook runs bun run check, so I don't accidentally push broken code.
If Bun runs there, the bot runs there.
For development I usually just start it locally:
bun run index.tsFor something long-running, you can throw it on a VPS with PM2, systemd, Docker, or whatever you normally use.
The frontend demo is hosted with GitHub Pages.
MIT.