Skip to content

About

Discord message templates for bots: validate, fetch and send Components V2 with discord.py and discord.js

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

discomposer

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

PyPI npm MIT license

How it works

  1. Your bot opens a template in the editor and describes what it offers (buttons, dynamic blocks, selections such as ticket categories or role pickers).
  2. A server admin designs the message and gets a short code.
  3. 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.

Packages

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

Other editors and reusable backend

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.

Development

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 test

Releases are described in RELEASING.md.

License

MIT. The hosted editor at editor.discomposer.dev is a separate, closed-source service.

discomposer is not affiliated with or endorsed by Discord Inc.

About

Discord message templates for bots: validate, fetch and send Components V2 with discord.py and discord.js

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages