From 98c1201688df2f835090ce357dccc81877d0c7bb Mon Sep 17 00:00:00 2001 From: Entwicklung Date: Sun, 26 Nov 2023 22:29:27 +0100 Subject: [PATCH] fix DOcker file --- Dockerfile | 3 +-- index.mjs | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index e94ceeb..7c9e089 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -FROM node:20-alpine -RUN apk install gcompat +FROM node:20 RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app USER root WORKDIR /home/node/app diff --git a/index.mjs b/index.mjs index b31ed31..ff9b92f 100644 --- a/index.mjs +++ b/index.mjs @@ -50,10 +50,13 @@ async function handleCommand(roomId, event) { // Check to ensure that the `!hello` command is being run const body = event['content']['body']; - if (!body?.startsWith("!jitsi")) return; - // Now that we've passed all the checks, we can actually act upon the command - await sendMessageWithUrl(client,roomId); - await changeRoomName(client, roomId); + if (body?.startsWith("!jitsi")){ + await sendMessageWithUrl(client,roomId); + await changeRoomName(client, roomId); + } + if (body?.startsWith("!help")){ + sendHelp(client,roomId) + } } function createConference(roomId) { @@ -72,4 +75,11 @@ async function changeRoomName(client, roomId){ if (!roomDescription.includes(conferenceUrl)){ await client.sendStateEvent(roomId,'m.room.topic','',{'topic':roomDescription+"\n\r"+conferenceUrl}) } +} +async function sendHelp(client, roomId){ + await client.sendText( + roomId, + 'Neue Konfernz mit "!jitsi" erstellen' + ); + } \ No newline at end of file