Files
Memoh/assets/channels_matrix.md.DurhP29P.js
2026-04-23 13:02:42 +00:00

11 lines
6.3 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as e,o as a,c as i,ag as s}from"./chunks/framework.CAXxHpAX.js";const u=JSON.parse('{"title":"Matrix Channel Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"channels/matrix.md","filePath":"channels/matrix.md","lastUpdated":1774790782000}'),o={name:"channels/matrix.md"};function n(r,t,l,h,d,c){return a(),i("div",null,[...t[0]||(t[0]=[s(`<h1 id="matrix-channel-configuration" tabindex="-1">Matrix Channel Configuration <a class="header-anchor" href="#matrix-channel-configuration" aria-label="Permalink to &quot;Matrix Channel Configuration&quot;"></a></h1><p>Connecting your Memoh Bot to Matrix allows it to communicate via the decentralized Matrix messaging protocol. Your bot can join rooms, respond to direct messages, and participate in group conversations on any Matrix homeserver.</p><h2 id="step-1-create-a-matrix-bot-account" tabindex="-1">Step 1: Create a Matrix Bot Account <a class="header-anchor" href="#step-1-create-a-matrix-bot-account" aria-label="Permalink to &quot;Step 1: Create a Matrix Bot Account&quot;"></a></h2><ol><li>Register a new account on your Matrix homeserver (e.g., via Element or any Matrix client).</li><li>Note the <strong>User ID</strong> (e.g., <code>@mybot:matrix.org</code>).</li><li>Obtain an <strong>Access Token</strong> for the account. You can do this by:</li></ol><ul><li>Option A: Using the Matrix Client Login API</li></ul><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -X</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> POST</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;https://&lt;homeserver&gt;/_matrix/client/v3/login&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -H</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Content-Type: application/json&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;{</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;type&quot;: &quot;m.login.password&quot;,</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;identifier&quot;: {</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;type&quot;: &quot;m.id.user&quot;,</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;user&quot;: &quot;&lt;username&gt;&quot;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> },</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;password&quot;: &quot;&lt;password&gt;&quot;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> }&#39;</span></span></code></pre></div><ul><li>Option B: Extract from a client</li></ul><blockquote><p><strong>Important</strong>: Keep the access token secret. Anyone with this token can act as your bot account.</p></blockquote><h2 id="step-2-configure-memoh" tabindex="-1">Step 2: Configure Memoh <a class="header-anchor" href="#step-2-configure-memoh" aria-label="Permalink to &quot;Step 2: Configure Memoh&quot;"></a></h2><ol><li>Go to your Bot&#39;s <strong>Platforms</strong> tab in the Memoh Web UI.</li><li>Click <strong>Add Channel</strong> and select <strong>Matrix</strong>.</li><li>Fill in the required fields:</li></ol><table tabindex="0"><thead><tr><th>Field</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><strong>Homeserver URL</strong></td><td>Yes</td><td>The base URL of your Matrix homeserver (e.g., <code>https://matrix.org</code>).</td></tr><tr><td><strong>Access Token</strong></td><td>Yes</td><td>The bot account&#39;s access token.</td></tr><tr><td><strong>User ID</strong></td><td>Yes</td><td>The bot&#39;s Matrix user ID (e.g., <code>@mybot:matrix.org</code>).</td></tr><tr><td><strong>Sync Timeout</strong></td><td>No</td><td>Long-polling timeout in seconds (default: 30).</td></tr><tr><td><strong>Auto Join Invites</strong></td><td>No</td><td>Automatically join rooms when invited (default: enabled).</td></tr></tbody></table><ol start="4"><li>Click <strong>Save and Enable</strong>.</li></ol><h2 id="step-3-invite-the-bot" tabindex="-1">Step 3: Invite the Bot <a class="header-anchor" href="#step-3-invite-the-bot" aria-label="Permalink to &quot;Step 3: Invite the Bot&quot;"></a></h2><ol><li>Open your Matrix client (Element, etc.).</li><li>Invite the bot&#39;s user ID to a room, or start a direct message.</li><li>If <strong>Auto Join Invites</strong> is enabled, the bot will automatically accept and join.</li></ol><h2 id="features-supported" tabindex="-1">Features Supported <a class="header-anchor" href="#features-supported" aria-label="Permalink to &quot;Features Supported&quot;"></a></h2><ul><li><strong>Message Content</strong>: Full access to text messages.</li><li><strong>Rooms</strong>: Join and participate in group rooms.</li><li><strong>Direct Messages</strong>: Private conversations with individual users.</li><li><strong>Streaming</strong>: Responses are streamed as they are generated.</li><li><strong>Markdown</strong>: Support for formatted text.</li><li><strong>Media/Attachment</strong>: Bots can receive and send files or photo.</li><li>Check <a href="https://github.com/memohai/Memoh/issues/249" target="_blank" rel="noreferrer">the roadmap</a> for more features of Matrix.</li></ul><h2 id="official-resources" tabindex="-1">Official Resources <a class="header-anchor" href="#official-resources" aria-label="Permalink to &quot;Official Resources&quot;"></a></h2><ul><li><a href="https://spec.matrix.org/" target="_blank" rel="noreferrer">Matrix Specification</a></li><li><a href="https://app.element.io/" target="_blank" rel="noreferrer">Element Web Client</a></li></ul>`,18)])])}const g=e(o,[["render",n]]);export{u as __pageData,g as default};