implement room joins - closes #14

master
lub 7 years ago
parent 8eff841b24
commit 0cb978d9d0

@ -22,3 +22,22 @@ lubiland['infrastructure']['rebuild'].exec = (args, room, event) => {
}); });
}); });
}; };
lubiland['heimdall'] = {};
lubiland['heimdall']['join'] = {};
lubiland['heimdall']['join'].regex = /^(.*)$/;
lubiland['heimdall']['join'].usage = '<container>';
lubiland['heimdall']['join'].exec = (args, room, event) => {
return new Promise((resolve, reject) => {
const roomId = args[1];
matrixClient.joinRoom(roomId)
.then((success) => {
matrixClient.sendNotice(room.roomId, ' joined ' + success.name);
}, (fail) => {
matrixClient.sendNotice(room.roomId, 'error while trying to join the other room: ' + fail.message);
})
});
};