photo support. don't ask

This commit is contained in:
Flummi 2021-05-11 07:32:08 +00:00
parent 7f6cb345b5
commit 6d66f2a5e1
3 changed files with 9 additions and 2 deletions

View File

@ -158,8 +158,11 @@ export default class irc extends EventEmitter {
if (tmpuser.cached < ~~(Date.now() / 1000) - this._recachetime) if (tmpuser.cached < ~~(Date.now() / 1000) - this._recachetime)
whois.push(u); whois.push(u);
} }
whois = whois.filter(e => e.trim());
if(whois.length === 0)
return false;
this.emit("data", ["info", `[irc] whois > ${whois}`]); this.emit("data", ["info", `[irc] whois > ${whois}`]);
this.send(`WHOIS ${whois}`); this.send(`WHOIS ${whois.join(',')}`);
} }
parsePrefix(prefix) { parsePrefix(prefix) {
prefix = /:?(.*)\!(.*)@(.*)/.exec(prefix); prefix = /:?(.*)\!(.*)@(.*)/.exec(prefix);

View File

@ -11,7 +11,10 @@ export default bot => {
bot._cmd.set("315", msg => { // who_end bot._cmd.set("315", msg => { // who_end
bot.server.channel.set(chan, whois); bot.server.channel.set(chan, whois);
whois = [...new Set(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 = []; whois = [];
}); });
}; };

View File

@ -130,6 +130,7 @@ export default class tg extends EventEmitter {
message: tmp.text, message: tmp.text,
time: tmp.date, time: tmp.date,
raw: tmp, raw: tmp,
photo: tmp.photo || null,
reply: msg => this.send(tmp.chat.id, msg, tmp.message_id), reply: msg => this.send(tmp.chat.id, msg, tmp.message_id),
replyAction: msg => this.send(tmp.chat.id, `Uwe ${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), replyNotice: msg => this.send(tmp.chat.id, msg, tmp.message_id),