Properly handle the option to use ghost or release
This commit is contained in:
parent
22b353b979
commit
1766f54b21
@ -75,4 +75,6 @@ TIMESTAMP_FORMAT = "[%Y-%m-%d %H:%M:%S{tzoffset}]"
|
|||||||
#CHANSERV = "x@channels.undernet.org"
|
#CHANSERV = "x@channels.undernet.org"
|
||||||
#CHANSERV_OP_COMMAND = "OP {channel}"
|
#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:
|
# vim: set ft=python:
|
||||||
|
@ -91,7 +91,7 @@ def connect_callback(cli):
|
|||||||
if not botconfig.PASS or bot_nick == nick:
|
if not botconfig.PASS or bot_nick == nick:
|
||||||
return # prevents the bot from trying to release without a password
|
return # prevents the bot from trying to release without a password
|
||||||
func = cli.ns_release
|
func = cli.ns_release
|
||||||
if getattr(botconfig, "USE_NICKSERV_GHOST", False): # FIXME
|
if botconfig.USE_NICKSERV_GHOST:
|
||||||
func = cli.ns_ghost
|
func = cli.ns_ghost
|
||||||
func(nick=botconfig.NICK, password=botconfig.PASS, nickserv=var.NICKSERV, command=var.NICKSERV_RELEASE_COMMAND)
|
func(nick=botconfig.NICK, password=botconfig.PASS, nickserv=var.NICKSERV, command=var.NICKSERV_RELEASE_COMMAND)
|
||||||
users.Bot.change_nick(botconfig.NICK)
|
users.Bot.change_nick(botconfig.NICK)
|
||||||
|
@ -53,6 +53,15 @@ except AttributeError:
|
|||||||
sep="\n")
|
sep="\n")
|
||||||
sys.exit(1)
|
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
|
from oyoyo.client import IRCClient
|
||||||
|
|
||||||
import src
|
import src
|
||||||
|
Loading…
Reference in New Issue
Block a user