bugfixes
- 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:
parent
d3b9192fcc
commit
d948f7f582
|
@ -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": {},
|
||||
|
|
|
@ -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/, ""),
|
||||
|
|
|
@ -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.`);
|
||||
|
|
Loading…
Reference in New Issue
Block a user