Skip to content

Space: Add a broadcast method #66

Open

Description

@PenguinBoi12

A broadcast method could be a good way to let bot authors send announcements or notices to every room in a space without looping manually.

Proposed API

async def broadcast(
    self,
    content: str,
    *,
    raw: bool = False,
    notice: bool = False,
) -> list[Message]:

Returns a list of Message objects (one per room the message was successfully sent to), consistent with how Room.send works.

Example

space = bot.get_space("!space123:matrix.org")
messages = await space.broadcast("Maintenance starts in 10 minutes.", notice=True)

Before opening a PR

  • Write unit tests
  • Run mypy matrix/
  • Run pytest tests/
  • Run black .

Activity

  1. changed the title [-]Add a `broadcast` method to the `Space` class that sends a message to all child rooms the bot has joined.[/-] [+]Space: Add a `broadcast` method[/+] on Jul 1, 2026
  2. grivera64 commented on Jul 1, 2026

    @grivera64

    Can I be assigned to this issue? Currently working on a PR

  3. grivera64 commented on Jul 3, 2026

    @grivera64

    Thanks! I made a PR at #86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions