def prepare_stuff(cli, prefix, *args): alog("Received end of MOTD from {0}".format(prefix)) # just in case we haven't managed to successfully auth yet if not botconfig.SASL_AUTHENTICATION: cli.ns_identify(botconfig.USERNAME or botconfig.NICK, botconfig.PASS, nickserv=var.NICKSERV, command=var.NICKSERV_IDENTIFY_COMMAND) channels = {botconfig.CHANNEL} if botconfig.ALT_CHANNELS: channels.update(botconfig.ALT_CHANNELS.split(",")) if botconfig.DEV_CHANNEL: channels.update(chan.lstrip("".join(var.STATUSMSG_PREFIXES)) for chan in botconfig.DEV_CHANNEL.split(",")) cli.join(",".join(channels)) 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) wolfgame.connect_callback(cli)
def prepare_stuff(cli, prefix, *args): from src import lagcheck alog("Received end of MOTD from {0}".format(prefix)) # This callback only sets up event listeners wolfgame.connect_callback() # just in case we haven't managed to successfully auth yet if botconfig.PASS and not botconfig.SASL_AUTHENTICATION: cli.ns_identify(botconfig.USERNAME or botconfig.NICK, botconfig.PASS, nickserv=var.NICKSERV, command=var.NICKSERV_IDENTIFY_COMMAND) # give bot operators an opportunity to do some custom stuff here if they wish event = Event("irc_connected", {}) event.dispatch(var, cli) # don't join any channels if we're just doing a lag check if not lagcheck: channels.Main = channels.add(botconfig.CHANNEL, cli) channels.Dummy = channels.add("*", cli) if botconfig.ALT_CHANNELS: for chan in botconfig.ALT_CHANNELS.split(","): channels.add(chan, cli) if botconfig.DEV_CHANNEL: channels.Dev = channels.add(botconfig.DEV_CHANNEL, cli) if var.LOG_CHANNEL: channels.add(var.LOG_CHANNEL, cli) else: alog("Preparing lag check") # if we ARE doing a lagcheck, we need at least our own host or things break users.Bot.who() users.Bot.change_nick(botconfig.NICK) if var.SERVER_PING_INTERVAL > 0: def ping_server_timer(cli): ping_server(cli) t = threading.Timer(var.SERVER_PING_INTERVAL, ping_server_timer, args=(cli, )) t.daemon = True t.start() ping_server_timer(cli) hook.unhook(294)
def prepare_stuff(cli, prefix, *args): from src import lagcheck alog("Received end of MOTD from {0}".format(prefix)) # This callback only sets up event listeners wolfgame.connect_callback() # just in case we haven't managed to successfully auth yet if botconfig.PASS and not botconfig.SASL_AUTHENTICATION: cli.ns_identify(botconfig.USERNAME or botconfig.NICK, botconfig.PASS, nickserv=var.NICKSERV, command=var.NICKSERV_IDENTIFY_COMMAND) # don't join any channels if we're just doing a lag check if not lagcheck: channels.Main = channels.add(botconfig.CHANNEL, cli) channels.Dummy = channels.add("*", cli) if botconfig.ALT_CHANNELS: for chan in botconfig.ALT_CHANNELS.split(","): channels.add(chan, cli) if botconfig.DEV_CHANNEL: channels.Dev = channels.add(botconfig.DEV_CHANNEL, cli) if var.LOG_CHANNEL: channels.add(var.LOG_CHANNEL, cli) #if var.CHANSERV_OP_COMMAND: # TODO: Add somewhere else if needed # cli.msg(var.CHANSERV, var.CHANSERV_OP_COMMAND.format(channel=botconfig.CHANNEL)) users.Bot.change_nick(botconfig.NICK) if var.SERVER_PING_INTERVAL > 0: def ping_server_timer(cli): ping_server(cli) t = threading.Timer(var.SERVER_PING_INTERVAL, ping_server_timer, args=(cli, )) t.daemon = True t.start() ping_server_timer(cli) if lagcheck: cli.command_handler["privmsg"] = on_privmsg run_lagcheck(cli)
def prepare_stuff(cli, prefix, *args): from src import lagcheck alog("Received end of MOTD from {0}".format(prefix)) # This callback only sets up event listeners wolfgame.connect_callback() # just in case we haven't managed to successfully auth yet if botconfig.PASS and not botconfig.SASL_AUTHENTICATION: cli.ns_identify(botconfig.USERNAME or botconfig.NICK, botconfig.PASS, nickserv=var.NICKSERV, command=var.NICKSERV_IDENTIFY_COMMAND) # don't join any channels if we're just doing a lag check if not lagcheck: channels.Main = channels.add(botconfig.CHANNEL, cli) channels.Dummy = channels.add("*", cli) if botconfig.ALT_CHANNELS: for chan in botconfig.ALT_CHANNELS.split(","): channels.add(chan, cli) if botconfig.DEV_CHANNEL: channels.Dev = channels.add(botconfig.DEV_CHANNEL, cli) if var.LOG_CHANNEL: channels.add(var.LOG_CHANNEL, cli) else: alog("Preparing lag check") # if we ARE doing a lagcheck, we need at least our own host or things break users.Bot.who() #if var.CHANSERV_OP_COMMAND: # TODO: Add somewhere else if needed # cli.msg(var.CHANSERV, var.CHANSERV_OP_COMMAND.format(channel=botconfig.CHANNEL)) users.Bot.change_nick(botconfig.NICK) if var.SERVER_PING_INTERVAL > 0: def ping_server_timer(cli): ping_server(cli) t = threading.Timer(var.SERVER_PING_INTERVAL, ping_server_timer, args=(cli,)) t.daemon = True t.start() ping_server_timer(cli)
def prepare_stuff(*args): # just in case we haven't managed to successfully auth yet if not botconfig.SASL_AUTHENTICATION: cli.ns_identify(botconfig.PASS) cli.join(botconfig.CHANNEL) if botconfig.ALT_CHANNELS: cli.join(botconfig.ALT_CHANNELS) if botconfig.DEV_CHANNEL: cli.join(",".join(chan.lstrip("".join(var.STATUSMSG_PREFIXES)) for chan in botconfig.DEV_CHANNEL.split(","))) cli.msg("ChanServ", "op "+botconfig.CHANNEL) cli.cap("REQ", "extended-join") cli.cap("REQ", "account-notify") wolfgame.connect_callback(cli) cli.nick(botconfig.NICK) # very important (for regain/release)