allow /notice commands as an option in the botconfig (not turned on by default)
This commit is contained in:
parent
0ae9781c5e
commit
033aa41917
@ -10,6 +10,8 @@ CHANGING_HOST_QUIT_MESSAGE = "Changing host"
|
|||||||
JOIN_AFTER_CLOAKED = True # Set to false if the bot does not have a cloak
|
JOIN_AFTER_CLOAKED = True # Set to false if the bot does not have a cloak
|
||||||
DISABLE_DEBUG_MODE = False # Entirely disable debug mode
|
DISABLE_DEBUG_MODE = False # Entirely disable debug mode
|
||||||
IGNORE_HIDDEN_COMMANDS = True # Ignore commands sent to @#channel or +#channel
|
IGNORE_HIDDEN_COMMANDS = True # Ignore commands sent to @#channel or +#channel
|
||||||
|
ALLOW_NOTICE_COMMANDS = False # allow /notice #channel !command to be interpreted as a command
|
||||||
|
ALLOW_PRIVATE_NOTICE_COMMANDS = False # allow !command's from /notice (Private)
|
||||||
|
|
||||||
OWNERS = ("unaffiliated/wolfbot_admin1",) # the comma is required at the end if there is one owner
|
OWNERS = ("unaffiliated/wolfbot_admin1",) # the comma is required at the end if there is one owner
|
||||||
ADMINS = ("unaffiliated/wolfbot_admin2", "unaffiliated/wolfbot_admin3") # glob syntax supported (wildcards)
|
ADMINS = ("unaffiliated/wolfbot_admin2", "unaffiliated/wolfbot_admin3") # glob syntax supported (wildcards)
|
||||||
|
@ -7,12 +7,16 @@ import tools.moduleloader as ld
|
|||||||
import traceback
|
import traceback
|
||||||
from settings import common as var
|
from settings import common as var
|
||||||
|
|
||||||
def on_privmsg(cli, rawnick, chan, msg):
|
def on_privmsg(cli, rawnick, chan, msg, notice = False):
|
||||||
currmod = ld.MODULES[ld.CURRENT_MODULE]
|
currmod = ld.MODULES[ld.CURRENT_MODULE]
|
||||||
|
|
||||||
if botconfig.IGNORE_HIDDEN_COMMANDS and (chan.startswith("@#") or chan.startswith("+#")):
|
if botconfig.IGNORE_HIDDEN_COMMANDS and (chan.startswith("@#") or chan.startswith("+#")):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if (notice and ((chan != botconfig.NICK and not botconfig.ALLOW_NOTICE_COMMANDS) or
|
||||||
|
(chan == botconfig.NICK and not botconfig.ALLOW_PRIVATE_NOTICE_COMMANDS))):
|
||||||
|
return # not allowed in settings
|
||||||
|
|
||||||
if chan != botconfig.NICK: #not a PM
|
if chan != botconfig.NICK: #not a PM
|
||||||
if currmod and "" in currmod.COMMANDS.keys():
|
if currmod and "" in currmod.COMMANDS.keys():
|
||||||
for fn in currmod.COMMANDS[""]:
|
for fn in currmod.COMMANDS[""]:
|
||||||
|
@ -35,6 +35,45 @@ hook = decorators.generate(HOOKS, raw_nick=True, permissions=False)
|
|||||||
|
|
||||||
# Game Logic Begins:
|
# Game Logic Begins:
|
||||||
|
|
||||||
|
var.LAST_PING = None # time of last ping
|
||||||
|
var.LAST_STATS = None
|
||||||
|
var.LAST_VOTES = None
|
||||||
|
var.LAST_ADMINS = None
|
||||||
|
|
||||||
|
var.USERS = {}
|
||||||
|
|
||||||
|
var.PINGING = False
|
||||||
|
var.ADMIN_PINGING = False
|
||||||
|
var.ROLES = {"person" : []}
|
||||||
|
var.ORIGINAL_ROLES = {}
|
||||||
|
var.PLAYERS = {}
|
||||||
|
var.DCED_PLAYERS = {}
|
||||||
|
var.ADMIN_TO_PING = None
|
||||||
|
var.AFTER_FLASTGAME = None
|
||||||
|
var.PHASE = "none" # "join", "day", or "night"
|
||||||
|
var.TIMERS = [None, None]
|
||||||
|
var.DEAD = []
|
||||||
|
|
||||||
|
var.ORIGINAL_SETTINGS = {}
|
||||||
|
|
||||||
|
var.LAST_SAID_TIME = {}
|
||||||
|
|
||||||
|
var.GAME_START_TIME = datetime.now() # for idle checker only
|
||||||
|
var.GRAVEYARD_LOCK = threading.RLock()
|
||||||
|
var.GAME_ID = 0
|
||||||
|
|
||||||
|
var.DISCONNECTED = {} # players who got disconnected
|
||||||
|
|
||||||
|
var.LOGGER = WolfgameLogger(var.LOG_FILENAME, var.BARE_LOG_FILENAME)
|
||||||
|
|
||||||
|
if botconfig.DEBUG_MODE:
|
||||||
|
var.NIGHT_TIME_LIMIT = 0 # 90
|
||||||
|
var.DAY_TIME_LIMIT_WARN = 0
|
||||||
|
var.DAY_TIME_LIMIT_CHANGE = 0
|
||||||
|
var.KILL_IDLE_TIME = 0 #300
|
||||||
|
var.WARN_IDLE_TIME = 0 #180
|
||||||
|
|
||||||
|
|
||||||
def connect_callback(cli):
|
def connect_callback(cli):
|
||||||
to_be_devoiced = []
|
to_be_devoiced = []
|
||||||
|
|
||||||
@ -73,44 +112,6 @@ def connect_callback(cli):
|
|||||||
|
|
||||||
cli.who(botconfig.CHANNEL, "%nuhaf")
|
cli.who(botconfig.CHANNEL, "%nuhaf")
|
||||||
|
|
||||||
var.LAST_PING = None # time of last ping
|
|
||||||
var.LAST_STATS = None
|
|
||||||
var.LAST_VOTES = None
|
|
||||||
var.LAST_ADMINS = None
|
|
||||||
|
|
||||||
var.USERS = {}
|
|
||||||
|
|
||||||
var.PINGING = False
|
|
||||||
var.ADMIN_PINGING = False
|
|
||||||
var.ROLES = {"person" : []}
|
|
||||||
var.ORIGINAL_ROLES = {}
|
|
||||||
var.PLAYERS = {}
|
|
||||||
var.DCED_PLAYERS = {}
|
|
||||||
var.ADMIN_TO_PING = None
|
|
||||||
var.AFTER_FLASTGAME = None
|
|
||||||
var.PHASE = "none" # "join", "day", or "night"
|
|
||||||
var.TIMERS = [None, None]
|
|
||||||
var.DEAD = []
|
|
||||||
|
|
||||||
var.ORIGINAL_SETTINGS = {}
|
|
||||||
|
|
||||||
var.LAST_SAID_TIME = {}
|
|
||||||
|
|
||||||
var.GAME_START_TIME = datetime.now() # for idle checker only
|
|
||||||
var.GRAVEYARD_LOCK = threading.RLock()
|
|
||||||
var.GAME_ID = 0
|
|
||||||
|
|
||||||
var.DISCONNECTED = {} # players who got disconnected
|
|
||||||
|
|
||||||
var.LOGGER = WolfgameLogger(var.LOG_FILENAME, var.BARE_LOG_FILENAME)
|
|
||||||
|
|
||||||
if botconfig.DEBUG_MODE:
|
|
||||||
var.NIGHT_TIME_LIMIT = 0 # 90
|
|
||||||
var.DAY_TIME_LIMIT_WARN = 0
|
|
||||||
var.DAY_TIME_LIMIT_CHANGE = 0
|
|
||||||
var.KILL_IDLE_TIME = 0 #300
|
|
||||||
var.WARN_IDLE_TIME = 0 #180
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ def main():
|
|||||||
|
|
||||||
cli = IRCClient(
|
cli = IRCClient(
|
||||||
{"privmsg":modules.common.on_privmsg,
|
{"privmsg":modules.common.on_privmsg,
|
||||||
|
"notice":lambda a, b, c, d: modules.common.on_privmsg(a, b, c, d, True),
|
||||||
"":modules.common.__unhandled__},
|
"":modules.common.__unhandled__},
|
||||||
host=botconfig.HOST,
|
host=botconfig.HOST,
|
||||||
port=botconfig.PORT,
|
port=botconfig.PORT,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user