From 6d66f2a5e1b95d7e39931d6c9964f2a7f1d95d80 Mon Sep 17 00:00:00 2001 From: Flummi Date: Tue, 11 May 2021 07:32:08 +0000 Subject: [PATCH] photo support. don't ask --- src/clients/irc.mjs | 5 ++++- src/clients/irc/who.mjs | 5 ++++- src/clients/tg.mjs | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/clients/irc.mjs b/src/clients/irc.mjs index 1eaa2a5..1ef1a56 100644 --- a/src/clients/irc.mjs +++ b/src/clients/irc.mjs @@ -158,8 +158,11 @@ export default class irc extends EventEmitter { if (tmpuser.cached < ~~(Date.now() / 1000) - this._recachetime) whois.push(u); } + whois = whois.filter(e => e.trim()); + if(whois.length === 0) + return false; this.emit("data", ["info", `[irc] whois > ${whois}`]); - this.send(`WHOIS ${whois}`); + this.send(`WHOIS ${whois.join(',')}`); } parsePrefix(prefix) { prefix = /:?(.*)\!(.*)@(.*)/.exec(prefix); diff --git a/src/clients/irc/who.mjs b/src/clients/irc/who.mjs index 2d603d0..c6bfa38 100644 --- a/src/clients/irc/who.mjs +++ b/src/clients/irc/who.mjs @@ -11,7 +11,10 @@ export default bot => { bot._cmd.set("315", msg => { // who_end bot.server.channel.set(chan, whois); whois = [...new Set(whois)]; - Array(Math.ceil(whois.length / 10)).fill().map(_ => whois.splice(0, 10)).forEach(l => bot.whois(l)); + Array(Math.ceil(whois.length / 10)).fill().map(_ => whois.splice(0, 10)).forEach(l => { + //console.log(l); + bot.whois(l); + }); whois = []; }); }; diff --git a/src/clients/tg.mjs b/src/clients/tg.mjs index f563815..a06b227 100644 --- a/src/clients/tg.mjs +++ b/src/clients/tg.mjs @@ -130,6 +130,7 @@ export default class tg extends EventEmitter { message: tmp.text, time: tmp.date, raw: tmp, + photo: tmp.photo || null, reply: msg => this.send(tmp.chat.id, msg, tmp.message_id), replyAction: msg => this.send(tmp.chat.id, `Uwe ${msg}`, tmp.message_id), replyNotice: msg => this.send(tmp.chat.id, msg, tmp.message_id),