From 98c30e171491b8dbec2523bb0f920425a829a2bf Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Wed, 8 Sep 2010 19:32:06 -0500 Subject: [PATCH] module meta option to ignore when bot is addressed directly. the motivation for this is if you have commands that have been aliased that you do not want to fire when they normally would via 'bot: blah' --- Module.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Module.py b/Module.py index 914f42d..47ed72c 100644 --- a/Module.py +++ b/Module.py @@ -108,8 +108,16 @@ class Module(object): except NoOptionError: pass except NoSectionError: pass + ignore_prefix = False + try: + ignore_prefix = self.config.getboolean(self.__class__.__name__, 'meta.pubmsg_ignore_bot_prefix') + except NoOptionError: pass + except NoSectionError: pass + if not addressed_re.match(what) and need_prefix: return + elif addressed_re.match(what) and ignore_prefix: + return else: what = addressed_re.sub('', what)