Skip to content

feat: add Room.set_name() and Room.set_topic() methods - #82

Open
ishita-0301 wants to merge 2 commits into
Code-Society-Lab:mainfrom
ishita-0301:feature/room-set-name-topic
Open

feat: add Room.set_name() and Room.set_topic() methods#82
ishita-0301 wants to merge 2 commits into
Code-Society-Lab:mainfrom
ishita-0301:feature/room-set-name-topic

Conversation

@ishita-0301

Copy link
Copy Markdown
Contributor

Closes #69

Added \set_name(name)\ and \set_topic(topic)\ methods to \Room. Both use \client.room_put_state()\ to update the respective state events. Includes unit tests for success and error cases for each method.

@PenguinBoi12

PenguinBoi12 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@ishita-0301 can you please fix the conflicts and the comment. Thank you.

@PenguinBoi12
PenguinBoi12 self-requested a review July 2, 2026 04:43
@PenguinBoi12 PenguinBoi12 added the feature A new feature label Jul 2, 2026
Comment thread matrix/room.py
except Exception as e:
raise MatrixError(f"Failed to send message: {e}")

async def set_name(self, name: str) -> None:

@PenguinBoi12 PenguinBoi12 Jul 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new way to handle matrix calls has been added. Basically, the whole body of the function would become:

await matrix_call( 
    self.client.room_put_state(
        room_id=self.room_id,
        event_type="m.room.name",
        content={"name": name},
    ),
    error_message="Failed to set room name"
)

Same thing for set_topic

@PenguinBoi12

Copy link
Copy Markdown
Contributor

Hello @ishita-0301 this PR is about to go stale and closed. Do you plan on finalizing it?

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

Labels

feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Room: Add set_name and set_topic methods

2 participants