Skip to content

Formatted Messages (Embed-like) #95

Description

@PenguinBoi12

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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions