Properly handle the option to use ghost or release

This commit is contained in:
Vgr E. Barry 2016-11-18 21:14:15 -05:00
parent 22b353b979
commit 1766f54b21
3 changed files with 12 additions and 1 deletions

View File

@ -75,4 +75,6 @@ TIMESTAMP_FORMAT = "[%Y-%m-%d %H:%M:%S{tzoffset}]"
#CHANSERV = "x@channels.undernet.org"
#CHANSERV_OP_COMMAND = "OP {channel}"
USE_NICKSERV_GHOST = False # If set to True, the bot will GHOST users using the bot's nick. Otherwise, it will use RELEASE
# vim: set ft=python:

View File

@ -91,7 +91,7 @@ def connect_callback(cli):
if not botconfig.PASS or bot_nick == nick:
return # prevents the bot from trying to release without a password
func = cli.ns_release
if getattr(botconfig, "USE_NICKSERV_GHOST", False): # FIXME
if botconfig.USE_NICKSERV_GHOST:
func = cli.ns_ghost
func(nick=botconfig.NICK, password=botconfig.PASS, nickserv=var.NICKSERV, command=var.NICKSERV_RELEASE_COMMAND)
users.Bot.change_nick(botconfig.NICK)

View File

@ -53,6 +53,15 @@ except AttributeError:
sep="\n")
sys.exit(1)
try:
botconfig.USE_NICKSERV_GHOST
except AttributeError:
print("Please set up your config to include a USE_NICKSERV_GHOST variable",
"It should be a boolean value, determining whether to use GHOST or RELEASE",
"(See botconfig.py.example for an informative comment)",
sep="\n")
sys.exit(1)
from oyoyo.client import IRCClient
import src