Merge pull request #16 from H2-invent/development

add info when bot starts
This commit is contained in:
holema 2023-12-05 23:09:24 +01:00 committed by GitHub
commit 3e24f63e29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -29,12 +29,12 @@ export class conferenceUtils {
async sendJoinConference(roomId) { async sendJoinConference(roomId) {
var url = await this.createConference(roomId); var url = await this.createConference(roomId);
await this.client.sendHtmlText(roomId, '<div role="button" tabindex="0" class="mx_AccessibleButton mx_MemberList_invite"><a href ="' + url + '">Hier der Konferenz beitreten</a></div> '); await this.client.sendHtmlText(roomId, '<a href ="' + url + '">Hier der Konferenz beitreten</a> ');
} }
async inviteAll(roomId) { async inviteAll(roomId) {
var url = await this.createConference(roomId); var url = await this.createConference(roomId);
var text = '@room <h1>Diese Konferenz startet gerade</h1><br><a href="'+url+'">Jetzt dieser Konfernz beitreten</a>' var text = '@room <h2>Diese Konferenz startet gerade</h2><br><a href="'+url+'">➡️Jetzt dieser Konfernz beitreten</a>'
await this.client.sendHtmlText(roomId, text); await this.client.sendHtmlText(roomId, text);
} }

View file

@ -33,6 +33,13 @@ client.on("room.join", handlemembership);
client.start().then(() => console.log("Bot started!")); client.start().then(() => console.log("Bot started!"));
client.setDisplayName(MATRIX_DISPLAYNAME) client.setDisplayName(MATRIX_DISPLAYNAME)
client.getWhoAmI().then(userInfo => {
console.log("Logged in as User:", userInfo.user_id);
console.log("Logged in with the device ID:", userInfo.device_id);
}).catch(err => {
console.error("Error verifying session:", err);
});
const conferenceUtil = new conferenceUtils(client); const conferenceUtil = new conferenceUtils(client);
// This is the command handler we registered a few lines up // This is the command handler we registered a few lines up
async function handleCommand(roomId, event) { async function handleCommand(roomId, event) {