diff --git a/config.mjs b/config.mjs index 133488f..bd9ecd0 100644 --- a/config.mjs +++ b/config.mjs @@ -2,4 +2,5 @@ export var MATRIX_TOKEN=process.env.MATRIX_TOKEN ||"sys_xxxx" export var MATRIX_URL=process.env.MATRIX_URL || "https://matrix.org"; export var JITSI_ADMIN_URL =process.env.JITSI_ADMIN_URL || 'https://jitsi-admin.de'; export var MATRIX_USERNAME =process.env.MATRIX_USERNAME || 'h2inventbot'; -export var MATRIX_PASSWORD =process.env.MATRIX_PASSWORD || 'xxxxxxxx'; \ No newline at end of file +export var MATRIX_PASSWORD =process.env.MATRIX_PASSWORD || 'xxxxxxxx'; +export var MATRIX_DISPLAYNAME =process.env.MATRIX_DISPLAYNAME || 'Raumassistent'; \ No newline at end of file diff --git a/index.mjs b/index.mjs index 5a993e3..665b314 100644 --- a/index.mjs +++ b/index.mjs @@ -1,7 +1,7 @@ import {AutojoinRoomsMixin, MatrixClient, RustSdkCryptoStorageProvider, SimpleFsStorageProvider} from "matrix-bot-sdk"; import {md5} from 'js-md5'; -import {JITSI_ADMIN_URL, MATRIX_TOKEN, MATRIX_URL} from './config.mjs' +import {JITSI_ADMIN_URL, MATRIX_DISPLAYNAME, MATRIX_TOKEN, MATRIX_URL} from './config.mjs' const cryptoProvider = new RustSdkCryptoStorageProvider("./crypto-storage/"); @@ -32,7 +32,7 @@ client.on("room.message", handleCommand); // Now that everything is set up, start the bot. This will start the sync loop and run until killed. client.start().then(() => console.log("Bot started!")); - +client.setDisplayName(MATRIX_DISPLAYNAME) // This is the command handler we registered a few lines up async function handleCommand(roomId, event) { // Don't handle unhelpful events (ones that aren't text messages, are redacted, or sent by us)