Fix issues related to undernet (and in general)
- Now possible to use the bot without it having a registered account by blanking NICKSERV_IDENTIFY_COMMAND - Now possible to configure who ChanServ is as well as the command it uses to op up in channel (blank to prevent it from auto-opping). Example configuration provided for undernet - Properly autojoin channels even if there isn't an MOTD
This commit is contained in:
parent
b4c5fc4188
commit
dbb80a940e
@ -60,3 +60,5 @@ TIMESTAMP_FORMAT = "[%Y-%m-%d %H:%M:%S{tzoffset}]"
|
|||||||
#NICKSERV_GHOST_COMMAND = ""
|
#NICKSERV_GHOST_COMMAND = ""
|
||||||
#NICKSERV_RELEASE_COMMAND = ""
|
#NICKSERV_RELEASE_COMMAND = ""
|
||||||
#NICKSERV_REGAIN_COMMAND = ""
|
#NICKSERV_REGAIN_COMMAND = ""
|
||||||
|
#CHANSERV = "x@channels.undernet.org"
|
||||||
|
#CHANSERV_OP_COMMAND = "OP {channel}"
|
||||||
|
@ -273,7 +273,8 @@ class IRCClient(object):
|
|||||||
def kick(self, chan, nick, msg=""):
|
def kick(self, chan, nick, msg=""):
|
||||||
self.send("KICK", chan, nick, ":"+msg)
|
self.send("KICK", chan, nick, ":"+msg)
|
||||||
def ns_identify(self, account, passwd, nickserv, command):
|
def ns_identify(self, account, passwd, nickserv, command):
|
||||||
self.msg(nickserv, command.format(account=account, password=passwd))
|
if command:
|
||||||
|
self.msg(nickserv, command.format(account=account, password=passwd))
|
||||||
def ns_ghost(self, nickserv, command):
|
def ns_ghost(self, nickserv, command):
|
||||||
if command:
|
if command:
|
||||||
self.msg(nickserv, command.format(nick=self.nickname))
|
self.msg(nickserv, command.format(nick=self.nickname))
|
||||||
|
@ -101,7 +101,9 @@ def unhandled(cli, prefix, cmd, *args):
|
|||||||
notify_error(cli, botconfig.CHANNEL, log)
|
notify_error(cli, botconfig.CHANNEL, log)
|
||||||
|
|
||||||
def connect_callback(cli):
|
def connect_callback(cli):
|
||||||
def prepare_stuff(*args):
|
@hook("endofmotd", hookid=294)
|
||||||
|
@hook("nomotd", hookid=294)
|
||||||
|
def prepare_stuff(cli, *args):
|
||||||
# just in case we haven't managed to successfully auth yet
|
# just in case we haven't managed to successfully auth yet
|
||||||
if not botconfig.SASL_AUTHENTICATION:
|
if not botconfig.SASL_AUTHENTICATION:
|
||||||
cli.ns_identify(botconfig.USERNAME or botconfig.NICK,
|
cli.ns_identify(botconfig.USERNAME or botconfig.NICK,
|
||||||
@ -119,15 +121,13 @@ def connect_callback(cli):
|
|||||||
|
|
||||||
cli.join(",".join(channels))
|
cli.join(",".join(channels))
|
||||||
|
|
||||||
cli.msg("ChanServ", "op " + botconfig.CHANNEL)
|
if var.CHANSERV_OP_COMMAND:
|
||||||
|
cli.msg(var.CHANSERV, var.CHANSERV_OP_COMMAND.format(channel=botconfig.CHANNEL))
|
||||||
|
|
||||||
cli.nick(botconfig.NICK) # very important (for regain/release)
|
cli.nick(botconfig.NICK) # very important (for regain/release)
|
||||||
|
|
||||||
wolfgame.connect_callback(cli)
|
wolfgame.connect_callback(cli)
|
||||||
|
|
||||||
|
|
||||||
prepare_stuff = hook("endofmotd", hookid=294)(prepare_stuff)
|
|
||||||
|
|
||||||
def mustregain(cli, *blah):
|
def mustregain(cli, *blah):
|
||||||
if not botconfig.PASS:
|
if not botconfig.PASS:
|
||||||
return
|
return
|
||||||
|
@ -147,6 +147,8 @@ NICKSERV_IDENTIFY_COMMAND = "IDENTIFY {account} {password}"
|
|||||||
NICKSERV_GHOST_COMMAND = "GHOST {nick}"
|
NICKSERV_GHOST_COMMAND = "GHOST {nick}"
|
||||||
NICKSERV_RELEASE_COMMAND = "RELEASE {nick}"
|
NICKSERV_RELEASE_COMMAND = "RELEASE {nick}"
|
||||||
NICKSERV_REGAIN_COMMAND = "REGAIN {nick}"
|
NICKSERV_REGAIN_COMMAND = "REGAIN {nick}"
|
||||||
|
CHANSERV = "ChanServ"
|
||||||
|
CHANSERV_OP_COMMAND = "OP {channel}"
|
||||||
|
|
||||||
STASISED = defaultdict(int)
|
STASISED = defaultdict(int)
|
||||||
STASISED_ACCS = defaultdict(int)
|
STASISED_ACCS = defaultdict(int)
|
||||||
|
Loading…
Reference in New Issue
Block a user