diff --git a/src/inc/clients/irc/invite.js b/src/inc/clients/irc/invite.js new file mode 100644 index 0000000..6a2cf28 --- /dev/null +++ b/src/inc/clients/irc/invite.js @@ -0,0 +1,13 @@ +module.exports = client => { + client._cmd.set("INVITE", function (msg) { // invite + const user = this.parsePrefix(msg.prefix); + const channel = msg.params[1]; + + if(!this.server.channel.includes(channel)) { + this.join(channel); + setTimeout(() => { + this.send(`PRIVMSG ${channel} :Hi. Wurde von ${user.nick} eingeladen.`); + }, 1000); + } + }.bind(client)); +}; \ No newline at end of file