From 3b69c3e80fef82ff2d6c083dfd5d0184c812776b Mon Sep 17 00:00:00 2001 From: Flummi Date: Wed, 8 Nov 2017 22:29:43 +0100 Subject: [PATCH] fixed time --- src/bot.js | 8 ++++++-- src/inc/irc/irc.js | 2 +- src/inc/wrapper.js | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/bot.js b/src/bot.js index b2c1cf5..5feaf1c 100644 --- a/src/bot.js +++ b/src/bot.js @@ -1,9 +1,13 @@ import { cfg, read } from './inc/cfg.js'; -import { wrapper } from './inc/wrapper.js'; +import { wrapper, clients } from './inc/wrapper.js'; read().then(() => { let bot = new wrapper(); 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); }); + }); \ No newline at end of file diff --git a/src/inc/irc/irc.js b/src/inc/irc/irc.js index 5acf9c6..949bf55 100644 --- a/src/inc/irc/irc.js +++ b/src/inc/irc/irc.js @@ -90,7 +90,7 @@ class irc { channel: tmp.params[0], user: user, message: tmp.params[1].replace(/\r?\n|\r/g, ''), - time: Date.now(), + time: ~~(Date.now() / 1000), reply: msg => { this.send(`PRIVMSG ${tmp.params[0]} ${msg}`); }, diff --git a/src/inc/wrapper.js b/src/inc/wrapper.js index 1910103..61830ec 100644 --- a/src/inc/wrapper.js +++ b/src/inc/wrapper.js @@ -64,4 +64,4 @@ const replytg = (bot, tmp) => { // muss noch hier raus }; util.inherits(wrapper, EventEmitter); -export default { wrapper }; \ No newline at end of file +export default { wrapper, clients }; \ No newline at end of file