initial config support

master
lub 7 years ago committed by lub
parent 139310825d
commit 510fa3e900

3
.gitignore vendored

@ -1,4 +1,5 @@
node_modules
package-lock.json
.idea
*.log
*.log
config.yaml

@ -0,0 +1,3 @@
baseurl: 'https://example.org'
accesstoken: 't0ps3cr3t'
userid: '@jd:example.org'

@ -1,12 +1,14 @@
const spawn = require('child_process').spawn;
const fs = require('fs');
const sdk = require('matrix-js-sdk');
const spawn = require('child_process').spawn;
const yaml = require('js-yaml');
const config = yaml.safeLoad(fs.readFileSync('config.yaml'));
var userid = '';
var accesstoken = '';
var matrixclient = sdk.createClient({
baseUrl: 'https://imninja.net',
accessToken: accesstoken,
userId: userid
baseUrl: config.baseurl,
accessToken: config.accesstoken,
userId: config.userid
});
/*matrixclient.on('RoomMember.membership', function(event, member) {