mirror of
https://github.com/ncoevoet/ChanTracker.git
synced 2025-04-26 13:01:06 -05:00
Further improve exempting commands from prompt input.
This commit is contained in:
parent
e5ce04c99b
commit
10a1b41c47
15
plugin.py
15
plugin.py
@ -60,12 +60,13 @@ def checkAddressed(irc, text, channel):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def isCommand(irc, text):
|
def isCommand(cbs, args):
|
||||||
args = text.lower().split(None, 2)
|
for c in cbs:
|
||||||
for c in irc.callbacks:
|
if args[0] == c.name().lower() and len(args) > 1:
|
||||||
if (args[0] == c.name().lower() and len(args) > 1
|
return isCommand([c], args[1:])
|
||||||
and c.isCommandMethod(args[1])) \
|
if c.isCommandMethod(args[0]):
|
||||||
or c.isCommandMethod(args[0]):
|
return True
|
||||||
|
if isCommand(c.cbs, args):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@ -4114,7 +4115,7 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
if message:
|
if message:
|
||||||
self._logChan(irc, channel, message)
|
self._logChan(irc, channel, message)
|
||||||
elif irc.nick == channel and not (checkAddressed(irc, text, channel)
|
elif irc.nick == channel and not (checkAddressed(irc, text, channel)
|
||||||
or isCommand(irc, text)):
|
or isCommand(irc.callbacks, text.lower().split())):
|
||||||
found = self.hasAskedItems(irc, msg.prefix, remove=False, prompt=False)
|
found = self.hasAskedItems(irc, msg.prefix, remove=False, prompt=False)
|
||||||
if found:
|
if found:
|
||||||
tokens = callbacks.tokenize('ChanTracker editAndMark %s %s' % (found[0], text))
|
tokens = callbacks.tokenize('ChanTracker editAndMark %s %s' % (found[0], text))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user