From d407f9bbfb35af1ec4c5ae79acfe9146f4508653 Mon Sep 17 00:00:00 2001 From: jcao219 Date: Sun, 24 Jun 2012 01:46:50 -0500 Subject: [PATCH] allow the bot to ignore all commands sent to @#channel or +#channel (botconfig.py updated!) --- botconfig.py.example | 2 ++ modules/common.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/botconfig.py.example b/botconfig.py.example index f06bbbd..81fb2a8 100644 --- a/botconfig.py.example +++ b/botconfig.py.example @@ -6,8 +6,10 @@ USERNAME = "" # for authentication, can be left blank if same as NICK NICK = "mywolfbot" CMD_CHAR = "!" CHANGING_HOST_QUIT_MESSAGE = "Changing host" + JOIN_AFTER_CLOAKED = True # Set to false if the bot does not have a cloak DISABLE_DEBUG_MODE = False # Entirely disable debug mode +IGNORE_HIDDEN_COMMANDS = True # Ignore commands sent to @#channel or +#channel 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) diff --git a/modules/common.py b/modules/common.py index 018fab9..a371bea 100644 --- a/modules/common.py +++ b/modules/common.py @@ -12,6 +12,9 @@ def on_privmsg(cli, rawnick, chan, msg): currmod = ld.MODULES[ld.CURRENT_MODULE] else: currmod = None + + if botconfig.IGNORE_HIDDEN_COMMANDS and (chan.startswith("@#") or chan.startswith("+#")): + return if chan != botconfig.NICK: #not a PM if currmod and "" in currmod.COMMANDS.keys():