Matrix has no native equivalent of Discord embeds, so there is no built-in way to send visually structured output. Users who want to present tabular data or highlighted summaries must format strings by hand every time.
The idea is to introduce a lightweight message builder that renders structured content using Unicode box-drawing characters or any other interesting alternatives. This would be a pure formatting utility, no new Matrix event types, just a helper that produces a consistently styled string that any (most) Matrix client will display correctly.
Proposed API
box = MessageBox(title="Server Status")
box.add_field("Uptime", "3 days")
box.add_field("Rooms", "12")
await ctx.reply(box.render())
┌─────────────────┐
│ Server Status │
├─────────────────┤
│ Uptime │ 3 days│
│ Rooms │ 12 │
└─────────────────┘
The main constraint is that Matrix clients render messages in a monospace font only inside code blocks, a plain m.text message with box-drawing characters may not align correctly in all clients. Worth investigating whether wrapping the output in a <pre> block via m.room.message with format: org.matrix.custom.html is the right approach, and whether the fallback plain-text body should strip the box entirely or keep it as-is.
Ultimately, it might not be fully possible to support ALL client so we can focus on a couple of the most popular.
Matrix has no native equivalent of Discord embeds, so there is no built-in way to send visually structured output. Users who want to present tabular data or highlighted summaries must format strings by hand every time.
The idea is to introduce a lightweight message builder that renders structured content using Unicode box-drawing characters or any other interesting alternatives. This would be a pure formatting utility, no new Matrix event types, just a helper that produces a consistently styled string that any (most) Matrix client will display correctly.
Proposed API
The main constraint is that Matrix clients render messages in a monospace font only inside code blocks, a plain
m.textmessage with box-drawing characters may not align correctly in all clients. Worth investigating whether wrapping the output in a<pre>block viam.room.messagewithformat: org.matrix.custom.htmlis the right approach, and whether the fallback plain-text body should strip the box entirely or keep it as-is.Ultimately, it might not be fully possible to support ALL client so we can focus on a couple of the most popular.