Use STATUSMSG instead of hardcoding @+ prefixes
This commit is contained in:
parent
7fdd2bf98a
commit
d2bed1bf72
@ -9,6 +9,7 @@ from oyoyo.parse import parse_nick
|
|||||||
import imp
|
import imp
|
||||||
from tools import logger
|
from tools import logger
|
||||||
import socket
|
import socket
|
||||||
|
import settings.wolfgame as var
|
||||||
|
|
||||||
log = logger("errors.log")
|
log = logger("errors.log")
|
||||||
alog = logger(None)
|
alog = logger(None)
|
||||||
@ -37,11 +38,14 @@ def notify_error(cli, chan, target_logger):
|
|||||||
|
|
||||||
def on_privmsg(cli, rawnick, chan, msg, notice = False):
|
def on_privmsg(cli, rawnick, chan, msg, notice = False):
|
||||||
currmod = ld.MODULES[ld.CURRENT_MODULE]
|
currmod = ld.MODULES[ld.CURRENT_MODULE]
|
||||||
|
|
||||||
currmod.notify_error = notify_error
|
|
||||||
|
|
||||||
if botconfig.IGNORE_HIDDEN_COMMANDS and (chan.startswith("@#") or chan.startswith("+#")):
|
try:
|
||||||
return
|
prefixes = getattr(var, "STATUSMSG_PREFIXES")
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if botconfig.IGNORE_HIDDEN_COMMANDS and chan[0] in prefixes.keys():
|
||||||
|
return
|
||||||
|
|
||||||
if (notice and ((chan != botconfig.NICK and not botconfig.ALLOW_NOTICE_COMMANDS) or
|
if (notice and ((chan != botconfig.NICK and not botconfig.ALLOW_NOTICE_COMMANDS) or
|
||||||
(chan == botconfig.NICK and not botconfig.ALLOW_PRIVATE_NOTICE_COMMANDS))):
|
(chan == botconfig.NICK and not botconfig.ALLOW_PRIVATE_NOTICE_COMMANDS))):
|
||||||
@ -109,7 +113,7 @@ def connect_callback(cli):
|
|||||||
def prepare_stuff(*args):
|
def prepare_stuff(*args):
|
||||||
cli.join(botconfig.CHANNEL)
|
cli.join(botconfig.CHANNEL)
|
||||||
cli.join(botconfig.ALT_CHANNELS)
|
cli.join(botconfig.ALT_CHANNELS)
|
||||||
cli.join(",".join(chan.lstrip("@+") for chan in botconfig.DEV_CHANNEL.split(",")))
|
cli.join(",".join(chan.lstrip("".join(var.STATUSMSG_PREFIXES.keys())) for chan in botconfig.DEV_CHANNEL.split(",")))
|
||||||
cli.msg("ChanServ", "op "+botconfig.CHANNEL)
|
cli.msg("ChanServ", "op "+botconfig.CHANNEL)
|
||||||
|
|
||||||
cli.cap("REQ", "extended-join")
|
cli.cap("REQ", "extended-join")
|
||||||
|
Loading…
Reference in New Issue
Block a user