fix DOcker file

This commit is contained in:
Entwicklung 2023-11-26 22:29:27 +01:00
parent 5222e04329
commit 98c1201688
2 changed files with 15 additions and 6 deletions

View file

@ -1,5 +1,4 @@
FROM node:20-alpine FROM node:20
RUN apk install gcompat
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
USER root USER root
WORKDIR /home/node/app WORKDIR /home/node/app

View file

@ -50,10 +50,13 @@ async function handleCommand(roomId, event) {
// Check to ensure that the `!hello` command is being run // Check to ensure that the `!hello` command is being run
const body = event['content']['body']; const body = event['content']['body'];
if (!body?.startsWith("!jitsi")) return; if (body?.startsWith("!jitsi")){
// Now that we've passed all the checks, we can actually act upon the command await sendMessageWithUrl(client,roomId);
await sendMessageWithUrl(client,roomId); await changeRoomName(client, roomId);
await changeRoomName(client, roomId); }
if (body?.startsWith("!help")){
sendHelp(client,roomId)
}
} }
function createConference(roomId) { function createConference(roomId) {
@ -72,4 +75,11 @@ async function changeRoomName(client, roomId){
if (!roomDescription.includes(conferenceUrl)){ if (!roomDescription.includes(conferenceUrl)){
await client.sendStateEvent(roomId,'m.room.topic','',{'topic':roomDescription+"\n\r"+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'
);
} }