What this prompt does
This prompt builds an AI bot for [platform] (Discord or Slack) that handles [bot_purpose], written in [language]. It covers the full setup: API integration with correct permission scopes, slash command registration for [commands], thread-based conversations with context persistence, and AI responses via [model_provider].
The structure works because chat bots live or die on the boring infrastructure, not the AI call. Rate limiting of [rate_limit] requests per [rate_window] per user prevents abuse and cost blowouts, [storage] persists preferences and history across restarts, and admin commands give you usage stats and user blocking. The user-friendly error handling step — surfacing readable messages instead of leaking stack traces — is the small detail that separates a hobby bot from one a team actually trusts.
Rich message formatting and proper permission scopes are what make the bot feel native to [platform]. Embeds, buttons, and select menus turn flat text replies into interactive responses, while requesting only the scopes the bot needs keeps it secure and speeds up workspace approval. Deployment to [deploy_target] with automatic restart closes the loop, so a transient crash recovers on its own instead of leaving the bot silently offline until someone notices.
When to use it
- Your team lives in Discord or Slack and you want AI help available where they already work.
- You need slash commands like
[commands]rather than a single catch-all prompt box. - You want threaded conversations that remember context within a thread.
- You need per-user rate limiting to control cost and prevent abuse.
- You want persistent storage so the bot keeps preferences and history across restarts.
- You need a clean deployment to
[deploy_target]with automatic restart.
Example output
Expect a deployable bot in [language]: slash command definitions, event handlers for messages and threads, the [model_provider] integration, rate-limiting middleware, [storage] schema for preferences and history, rich message formatting (embeds, buttons, select menus), admin commands, and environment-variable configuration. It usually includes the [deploy_target] setup with restart handling.
Pro tips
- Request only the permission scopes you actually need; over-broad scopes are a security smell and slow team approval.
- Set
[rate_limit]and[rate_window]conservatively at first — it is easier to loosen limits than to recover from a cost spike. - Keep
[storage]simple for small teams; the SQLite default is plenty before you need a hosted database. - Define
[commands]with clear verbs and a short help string each, so users discover them without documentation. - Make error messages human-readable; never leak a stack trace into a channel where users will see it.
- Pick
[deploy_target]with built-in restart so a crash does not silently take the bot offline. - Use rich formatting (embeds, buttons, select menus) for replies that benefit from it, but keep simple answers plain to avoid clutter.
- Add admin commands for usage stats and user blocking early; you will want them the moment the bot gets real traffic.