Fix: give MatrixClient a real store so client.getRoom() works
The default StubStore.getRoom() always returns null, so every received
message bailed at the room lookup ('got m.room.message for unknown room').
A MemoryStore keeps joined rooms available for lookup.
This commit is contained in:
2
index.js
2
index.js
@@ -1,5 +1,6 @@
|
|||||||
import * as dotenv from 'dotenv';
|
import * as dotenv from 'dotenv';
|
||||||
import { MatrixClient } from 'matrix-js-sdk';
|
import { MatrixClient } from 'matrix-js-sdk';
|
||||||
|
import { MemoryStore } from 'matrix-js-sdk/lib/store/memory.js';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
@@ -9,6 +10,7 @@ console.log('🚀 Starting Ancestor Quote Bot...\n');
|
|||||||
const client = new MatrixClient({
|
const client = new MatrixClient({
|
||||||
accessToken: process.env.MATRIX_ACCESS_TOKEN,
|
accessToken: process.env.MATRIX_ACCESS_TOKEN,
|
||||||
baseUrl: process.env.MATRIX_HOME_SERVER,
|
baseUrl: process.env.MATRIX_HOME_SERVER,
|
||||||
|
store: new MemoryStore(),
|
||||||
});
|
});
|
||||||
|
|
||||||
function loadQuotes() {
|
function loadQuotes() {
|
||||||
|
|||||||
Reference in New Issue
Block a user