Fix issue where bot would spam services

This very simple fix probably seems redundant or even entirely
pointless, but it actually solves a big design flaw. It does not show
much for freenode, but for other networks (e.g. Esper), where I tweaked
my bot to use ns_ghost instead, it keeps trying to kill off an
(unregistered) nick, without having a password. This effectively causes
spam to the services, and results in an automatic ban.
This commit is contained in:
Vgr E.Barry 2014-08-05 02:40:52 -04:00
parent 85a342f9c5
commit 191a910098

View File

@ -113,9 +113,13 @@ def connect_callback(cli):
prepare_stuff = hook("endofmotd", hookid=294)(prepare_stuff)
def mustregain(cli, *blah):
if not botconfig.PASS:
return
cli.ns_regain()
def mustrelease(cli, *rest):
if not botconfig.PASS:
return # prevents the bot from trying to release without a password
cli.ns_release()
cli.nick(botconfig.NICK)