add info when bot starts

This commit is contained in:
Entwicklung 2023-12-05 23:08:38 +01:00
parent 43c5c5ac13
commit bf7302dd59
2 changed files with 9 additions and 2 deletions

View file

@ -29,12 +29,12 @@ export class conferenceUtils {
async sendJoinConference(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) {
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);
}

View file

@ -33,6 +33,13 @@ client.on("room.join", handlemembership);
client.start().then(() => console.log("Bot started!"));
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);
// This is the command handler we registered a few lines up
async function handleCommand(roomId, event) {