- use has() instead of includes() on Map.. stupid
- account has to be false if no account is provided
+ version bump
This commit is contained in:
Flummi 2019-11-26 05:32:11 +01:00
parent d3b9192fcc
commit d948f7f582
3 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "cuffeo", "name": "cuffeo",
"version": "1.0.2", "version": "1.0.3",
"description": "A multi-protocol chatbot library with nearly zero dependencies.", "description": "A multi-protocol chatbot library with nearly zero dependencies.",
"main": "src/index.mjs", "main": "src/index.mjs",
"scripts": {}, "scripts": {},

View File

@ -105,7 +105,7 @@ export default class irc extends EventEmitter {
channel: tmp.params[0], channel: tmp.params[0],
channelid: tmp.params[0], channelid: tmp.params[0],
user: { ...this.parsePrefix(tmp.prefix), ...{ 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 prefix: tmp.prefix.charAt(0) === ":" ? tmp.prefix.substring(1) : tmp.prefix
}}, }},
message: tmp.params[1].replace(/\u0002/, ""), message: tmp.params[1].replace(/\u0002/, ""),

View File

@ -3,7 +3,7 @@ export default bot => {
const user = bot.parsePrefix(msg.prefix); const user = bot.parsePrefix(msg.prefix);
const channel = msg.params[1]; const channel = msg.params[1];
if(!bot.server.channel.includes(channel)) { if(!bot.server.channel.has(channel)) {
bot.join(channel); bot.join(channel);
setTimeout(() => { setTimeout(() => {
bot.send(`PRIVMSG ${channel} :Hi. Wurde von ${user.nick} eingeladen.`); bot.send(`PRIVMSG ${channel} :Hi. Wurde von ${user.nick} eingeladen.`);