mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-27 21:41:09 -05:00
Replacer: swap order of comparisons in message filtering
Previously, this would error whenever a message without a first argument was present in irc.state.history. ERROR 2015-12-17T21:12:51 Uncaught exception in _callRegexp: Traceback (most recent call last): File "/home/gl/.local/lib/python3.4/site-packages/supybot/callbacks.py", line 1457, in _callRegexp method(irc, msg, m) File "/home/gl/SupyPlugins/Replacer/plugin.py", line 116, in replacer if m.args[0] == msg.args[0] and \ IndexError: tuple index out of range ERROR 2015-12-17T21:12:51 Exception id: 0x2b96f
This commit is contained in:
parent
688f00ac4d
commit
b347f658f8
@ -113,8 +113,8 @@ class Replacer(callbacks.PluginRegexp):
|
|||||||
|
|
||||||
next(iterable)
|
next(iterable)
|
||||||
for m in iterable:
|
for m in iterable:
|
||||||
if m.args[0] == msg.args[0] and \
|
if m.command == 'PRIVMSG' and \
|
||||||
m.command == 'PRIVMSG':
|
m.args[0] == msg.args[0]:
|
||||||
target = regex.group('nick')
|
target = regex.group('nick')
|
||||||
if not ircutils.isNick(str(target), strictRfc=True):
|
if not ircutils.isNick(str(target), strictRfc=True):
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user