A Nextcord (Discord) bot to manage and send pre-created FAQ snippets ("koils"). Moderators can add, view, delete, and send short messages that answer common questions.
- Manage reusable FAQ messages per server (SQLite-backed).
- Send by ID or by exact name.
- Clean, consistent embed responses for all actions.
- Moderator-only controls using Manage Messages permission.
- Python 3.10+
- Install deps:
pip install nextcord python-dotenv - Create
.env:DISCORD_TOKEN=your-bot-token
- Run locally:
python bot.py
- Add the bot to your server with the bot scope and permissions to send messages and use slash commands.
- Message Content intent is enabled in code; ensure it is toggled on in the Developer Portal if required for your use case.
- Slash command updates can take a minute to propagate after startup.
/koil help: Show help for all koil commands./koil add name:<text> description:<text>: Create a koil. Limits: name ≤ 50 chars, description ≤ 100 chars. (mods)/koil view: List all koils in this server (ephemeral). (mods)/koil delete koil_id:<id>: Delete a koil by ID. (mods)/koil send query:<id or name>: Send a koil to the channel by ID or exact name. (mods)/ping: Show bot latency (ephemeral).
- By default, the entire
/koilcommand group requires the Manage Messages permission (moderators). - To allow broader access (e.g., everyone can use
/koil send), remove the@application_checks.has_permissions(manage_messages=True)decorator from that subcommand inbot.py.
- SQLite database file:
koils.db(created automatically). - Table:
koils(id TEXT PRIMARY KEY, name TEXT, description TEXT, servID INTEGER). - Koils are namespaced per server via
servID.
- Use
/koil viewto copy IDs for/koil sendor/koil delete. - If
/koil sendfinds multiple exact-name matches, it asks you to use a specific ID.