2018-11-14 15:41:21 +00:00
|
|
|
var StatusJS = require('./src/index.js');
|
|
|
|
|
|
|
|
(async () => {
|
|
|
|
var status = new StatusJS();
|
2018-11-16 20:28:19 +00:00
|
|
|
await status.connect("/home/richard/.statusd/geth.ipc");
|
2018-11-14 15:41:21 +00:00
|
|
|
|
2018-11-16 20:28:19 +00:00
|
|
|
const channel = "mytest";
|
2018-11-14 17:51:12 +00:00
|
|
|
|
2018-11-16 20:28:19 +00:00
|
|
|
await status.joinChat(channel);
|
2018-11-14 17:51:12 +00:00
|
|
|
|
2018-11-16 20:28:19 +00:00
|
|
|
status.onMessage(channel, (err, data) => {
|
2018-11-16 21:57:21 +00:00
|
|
|
console.log(data.payload);
|
2018-11-16 20:28:19 +00:00
|
|
|
});
|
2018-11-14 17:51:12 +00:00
|
|
|
|
2018-11-16 20:28:19 +00:00
|
|
|
status.mailservers.useMailserver("mail-02.gc-us-central1-a.eth.beta", (err, res) => {
|
2018-11-16 21:57:21 +00:00
|
|
|
status.mailservers.requestMessages(channel, {}, (err, res) => {
|
|
|
|
if(err) console.log(err);
|
|
|
|
});
|
2018-11-14 15:41:21 +00:00
|
|
|
});
|
|
|
|
|
2018-11-16 20:28:19 +00:00
|
|
|
setInterval(() => { }, 3000);
|
2018-11-14 15:41:21 +00:00
|
|
|
})()
|