From d948f7f58286b3c25f0f7265ff7fa8080fd4a662 Mon Sep 17 00:00:00 2001 From: Flummi Date: Tue, 26 Nov 2019 05:32:11 +0100 Subject: [PATCH] bugfixes - use has() instead of includes() on Map.. stupid - account has to be false if no account is provided + version bump --- package.json | 2 +- src/clients/irc.mjs | 2 +- src/clients/irc/invite.mjs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0826c0f..2cff1e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cuffeo", - "version": "1.0.2", + "version": "1.0.3", "description": "A multi-protocol chatbot library with nearly zero dependencies.", "main": "src/index.mjs", "scripts": {}, diff --git a/src/clients/irc.mjs b/src/clients/irc.mjs index 9b4bfd2..796eaca 100644 --- a/src/clients/irc.mjs +++ b/src/clients/irc.mjs @@ -105,7 +105,7 @@ export default class irc extends EventEmitter { channel: tmp.params[0], channelid: tmp.params[0], user: { ...this.parsePrefix(tmp.prefix), ...{ - account: this.server.user.get(this.parsePrefix(tmp.prefix).nick).account, + account: this.server.user.has(this.parsePrefix(tmp.prefix).nick) ? this.server.user.get(this.parsePrefix(tmp.prefix).nick).account : false, prefix: tmp.prefix.charAt(0) === ":" ? tmp.prefix.substring(1) : tmp.prefix }}, message: tmp.params[1].replace(/\u0002/, ""), diff --git a/src/clients/irc/invite.mjs b/src/clients/irc/invite.mjs index e568b9d..7690ab7 100644 --- a/src/clients/irc/invite.mjs +++ b/src/clients/irc/invite.mjs @@ -3,7 +3,7 @@ export default bot => { const user = bot.parsePrefix(msg.prefix); const channel = msg.params[1]; - if(!bot.server.channel.includes(channel)) { + if(!bot.server.channel.has(channel)) { bot.join(channel); setTimeout(() => { bot.send(`PRIVMSG ${channel} :Hi. Wurde von ${user.nick} eingeladen.`);