- Install Node.js platform
- Install GraphicsMagick
- Premium Messenger (v2.0.0) needs latest Total.js from NPM
+v2.5.0
- License: MIT
- Live chat with professional support
- HelpDesk with professional support
- set up configuration file
/config
- run
$ node debug.js
(development) or$ node release.js
(production) - open
https://127.0.0.1:8000/
- sign in user:
[email protected]
, password:123456
(credentials are stored in/databases/users.json
)
- install Total.js as global module
npm install -g total.js
- then open Messenger directory
cd messenger
- then perform this command
totaljs --translate
- translate translated file
translate.resource
- and copy the content to
/resources/default.resource
- run app
F.on('messenger.open', function(controller, client) {
// open client
});
F.on('messenger.close', function(controller, client) {
// disconnected client
});
F.on('messenger.data', function(controller, client, data) {
// RAW data from websocket
// data === OBJECT
});
F.on('messenger.message', function(controller, client, message) {
// New message
// message === OBJECT
});
// How to send a message?
options = {};
// REQUIRED
options.iduser = 'ID USER WHICH SENDS MESSAGE';
options.target = 'channel'; // or "user"
options.idtarget = 'idchannel' // or "iduser"
options.body = 'MARKDOWN MESSAGE'; // how to perform like? just send ":thumbs-up:" in body
// OPTIONAL
options.id = 'ID MESSAGE'; // for editing of an existing message
options.users = ['iduser1', 'iduser2']; // optional, which users can by notified? (works with channels only)
options.files = [{ name: 'filename', url: 'url to download' }]; // optional, (it serves for file browser only)
OPERATION('send', options, function(err, response) {
console.log('DONE');
});
ON('messager.ready', function() {
// messenger is ready
});
ON('messenger.message', function(message) {
// message === OBJECT
});
ON('messenger.send', function(message) {
});
// You can register unlimited count of workflows with same name
WORKFLOW('messenger.render', function(message) {
// message.message - instance of retrieved message
// message.html - rendered HTML (can be modified)
// Example:
message.html = message.html.replace(/\,/g, ' --- ');
});
// How to send a message to the server via WebSocket?
SETTER('websocket', 'send', OBJECT);
+v2.0.0
. Administrators have disabled xss
protection, s each admin can inject a raw HTML into the markdown directly, example:
Only administrators can inject HTML directly via:
\```xss
<b>THIS WILL BE BOLDED</b>
\```
- Peter Širka (author) [email protected]
- Martin Smola (support) [email protected]