Simple Discord bot that responds to /yisang (or your configured prefix) by fetching a random SFW image from Danbooru and posting it to the channel.
Features
- Random SFW image from Danbooru (rating:safe)
- Global cooldown: 2 minutes between uses
Setup
- Copy
.env.exampleto.envand fill yourDISCORD_TOKEN. - Install dependencies:
# macOS / zsh
npm install- Run in development (requires
ts-node):
npm run dev- Notes
- This implementation uses an in-memory global cooldown (process-level). If you restart the bot the cooldown resets.
- Danbooru requires a polite User-Agent in requests; the bot sets one automatically.
-- Command example:
/yisang(or setPREFIXin.envto change it)
To install dependencies:
bun installTo run:
bun run index.tsThis project was created using bun init in bun v1.3.0. Bun is a fast all-in-one JavaScript runtime.