🧾 Project Prompt (Assignment)
Build a Discord bot that acts as an AI assistant by calling your AI API.
Create a Discord bot with a command that sends input to an AI API and posts the result back.
Requirements
- Slash command (e.g.,
/ask)
- Calls an AI API (your
/predict API or an LLM API)
- Handles timeouts + retries
- Enforces basic limits (max prompt length, max response length)
- Logs errors and returns friendly messages to users
🛠 Tools (Tech Stack)
- Node.js + discord.js (or Python + nextcord)
- HTTP client (fetch / axios / httpx)
- Environment variables for secrets
💡 Implementation Hints
- Reply immediately with “working…” then edit with final result
- Implement exponential backoff retry for transient failures
- Add rate limiting per user (simple in-memory map is fine)
- Store correlation ids in logs for debugging
Revisar MarksAI y hacerlo con API’s gratis