-
-
Save kfatehi/e0d56d3a391349299d37ff47ae69ec4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const { | |
Puppet | |
} = require("matrix-puppet-bridge"); | |
const puppet = new Puppet('/Users/ajohnson/matrixwork/rls/matrix-appservice-imessage/config.json'); | |
puppet.startClient().then(()=>{ | |
const client = puppet.getClient(); | |
var obj = JSON.parse(fs.readFileSync(process.argv[2])) | |
var desiredRoomAlias = obj.key.replace(/^@/, '#__mpb__'); | |
var roomId = obj.value.room_id; | |
console.log(roomId, desiredRoomAlias); | |
return client.createAlias(desiredRoomAlias, roomId).then(() => { | |
return client.stopClient(); | |
}); | |
}).catch((err)=> { | |
console.log(err.message); | |
process.exit(1); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment