From dd13e89469f6445565a94022d95f2b0364ea8d7f Mon Sep 17 00:00:00 2001 From: AlexMa233 Date: Sun, 29 Mar 2026 21:26:22 +0800 Subject: [PATCH] Enhance Matrix bot setup documentation (#308) * Enhance Matrix bot setup documentation Added instructions for obtaining an access token using the Matrix Client Login API and clarified the importance of keeping it secret. Updated details on bot capabilities and linked to the roadmap for future features. * Add warning about access token security Added important note about keeping the access token secret. --- docs/docs/channels/matrix.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/docs/channels/matrix.md b/docs/docs/channels/matrix.md index 8090c073..aa2d0499 100644 --- a/docs/docs/channels/matrix.md +++ b/docs/docs/channels/matrix.md @@ -7,8 +7,23 @@ Connecting your Memoh Bot to Matrix allows it to communicate via the decentraliz 1. Register a new account on your Matrix homeserver (e.g., via Element or any Matrix client). 2. Note the **User ID** (e.g., `@mybot:matrix.org`). 3. Obtain an **Access Token** for the account. You can do this by: - - Using the Matrix client login API: `POST /_matrix/client/r0/login` - - Or extracting it from your Matrix client's settings (Element: Settings > Help & About > Access Token). + +- Option A: Using the Matrix Client Login API + +```bash +curl -X POST "https:///_matrix/client/v3/login" \ + -H "Content-Type: application/json" \ + -d '{ + "type": "m.login.password", + "identifier": { + "type": "m.id.user", + "user": "" + }, + "password": "" + }' +``` + +- Option B: Extract from a client > **Important**: Keep the access token secret. Anyone with this token can act as your bot account. @@ -41,6 +56,8 @@ Connecting your Memoh Bot to Matrix allows it to communicate via the decentraliz - **Direct Messages**: Private conversations with individual users. - **Streaming**: Responses are streamed as they are generated. - **Markdown**: Support for formatted text. +- **Media/Attachment**: Bots can receive and send files or photo. +- Check [the roadmap](https://github.com/memohai/Memoh/issues/249) for more features of Matrix. ## Official Resources