martynsmith / node-irc

NodeJS IRC client library
GNU General Public License v3.0
1.33k stars 424 forks source link

Support a setting that keeps retrying for your nick #483

Open paladox opened 7 years ago

paladox commented 7 years ago

Hi could you please create a new setting that a user can set that will keep retrying for the specified nick name. Since net splits and the client keeps quitting when they re join, they come under a different name.

This would be useful for bot's.

sh1omi commented 7 years ago

You can try this fork of node-irc: https://github.com/matrix-org/node-irc

paladox commented 7 years ago

Oh thanks for link.

Is there a way to create custom commands like ! and the ability to match the message please?

sh1omi commented 7 years ago

There is docs for node-irc: https://node-irc.readthedocs.io/en/latest/API.html there is a "message" event to get the messages.

You can also check my bot https://github.com/sh1omi/IrcBot (the bot not using node-irc).

paladox commented 7 years ago

Thankyou.

moshmage commented 7 years ago

@sh1omi you don't need to use a fork to hook to a already existing event, ffs.

@paladox try hooking on the nick event, check if the old_nick is your configured nick and then update whatever you need to with new_nick. lib for reference

ex:

const myNick = "n04rk5";
client.addListener('nick', (oldNick, newNick) => {
    if (oldNick === myNick) {
        // do something
    }
});