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:
parent
f3e9568fe3
commit
98c30e1714
@ -108,8 +108,16 @@ class Module(object):
|
|||||||
except NoOptionError: pass
|
except NoOptionError: pass
|
||||||
except NoSectionError: 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:
|
if not addressed_re.match(what) and need_prefix:
|
||||||
return
|
return
|
||||||
|
elif addressed_re.match(what) and ignore_prefix:
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
what = addressed_re.sub('', what)
|
what = addressed_re.sub('', what)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user