1.1.0 • Published 11 months ago
botkit-matrix2 v1.1.0
botkit-matrix
A Botkit connector for Matrix
Install
$ npm install botkit-matrix2
Usage
let config = {
'baseUrl': 'https://matrix.org',
'botUserId': '@youruserid:matrix.org',
'password': 'yourpassword',
'localStorage': 'filepath'
};
require('botkit-matrix2').MatrixController(config)
.then((controller) => {
// get pm messages
controller.on('message_received', async function(data) {
if(data.e.type === 'm.room.message' && data.e.content.msgtype === 'm.text') {
console.log(data.e.content.body)
if(data.e.content.body === 'ping') {
data.middleware.send({
channel: data.e.room_id,
text: 'pong'
});
}
}
});
});
Authors
- Alice Sn0w - development - lukacssandor
based on: this repos
License
This project is licensed under Apache License 2.0 - see the LICENSE.md for details