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'
This commit is contained in:
Brian S. Stephan 2010-09-08 19:32:06 -05:00
parent f3e9568fe3
commit 98c30e1714
1 changed files with 8 additions and 0 deletions

View File

@ -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)