fixed time

This commit is contained in:
Flummi 2017-11-08 22:29:43 +01:00
parent a32efd38b4
commit 3b69c3e80f
3 changed files with 8 additions and 4 deletions

View File

@ -1,9 +1,13 @@
import { cfg, read } from './inc/cfg.js'; import { cfg, read } from './inc/cfg.js';
import { wrapper } from './inc/wrapper.js'; import { wrapper, clients } from './inc/wrapper.js';
read().then(() => { read().then(() => {
let bot = new wrapper(); let bot = new wrapper();
bot.on('message', e => { bot.on('message', e => {
console.log( e ); //if(e.type === "tg")
// clients[0].client.send(`PRIVMSG #kbot-dev ${e.user.nick}: ${e.message}`);
console.log(e.message);
}); });
}); });

View File

@ -90,7 +90,7 @@ class irc {
channel: tmp.params[0], channel: tmp.params[0],
user: user, user: user,
message: tmp.params[1].replace(/\r?\n|\r/g, ''), message: tmp.params[1].replace(/\r?\n|\r/g, ''),
time: Date.now(), time: ~~(Date.now() / 1000),
reply: msg => { reply: msg => {
this.send(`PRIVMSG ${tmp.params[0]} ${msg}`); this.send(`PRIVMSG ${tmp.params[0]} ${msg}`);
}, },

View File

@ -64,4 +64,4 @@ const replytg = (bot, tmp) => { // muss noch hier raus
}; };
util.inherits(wrapper, EventEmitter); util.inherits(wrapper, EventEmitter);
export default { wrapper }; export default { wrapper, clients };