Discord message templates for bots: design messages in a visual editor, send them as Components V2 from discord.py or discord.js.
Website · Editor · Documentation
- Your bot opens a template in the editor and describes what it offers (buttons, dynamic blocks, selections such as ticket categories or role pickers).
- A server admin designs the message and gets a short code.
- Your bot fetches the template with the code, validates it, keeps copies of editor uploads and sends it.
What buttons and selections do stays in your bot. The libraries only build and validate messages.
| Package | For | Install |
|---|---|---|
| packages/python | discord.py 2.6+ | pip install discomposer |
| packages/js | discord.js 14.19+ | npm install discomposer discord.js |
Both libraries implement the same template format and are tested against the same fixtures, so a template behaves the same in either language.
- examples/discordpy_bot.py: role picker bot with discord.py
- examples/discordjs-bot.mjs: the same bot with discord.js
Both clients accept your own editor URL (baseUrl in JavaScript, base_url in
Python). The editor protocol explains components, storage and the
complete bot/editor exchange. The JS package includes a reusable
discomposer/server backend and discomposer/format validator without a frontend.
See examples/template-server.mjs for a local Node server.
pip install -e "./packages/python[test,lint]"
python -m ruff check --config packages/python/pyproject.toml packages/python/src packages/python/tests examples/discordpy_bot.py
python -m pytest packages/python/tests
npm --prefix packages/js ci
npm --prefix packages/js testReleases are described in RELEASING.md.
MIT. The hosted editor at editor.discomposer.dev is a separate, closed-source service.
discomposer is not affiliated with or endorsed by Discord Inc.