mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Use the new msg.repliedTo tag.
This commit is contained in:
parent
4605ce84f8
commit
da5fd46bb1
@ -474,6 +474,9 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp):
|
||||
_forceRe = re.compile(r'^no[,: -]+', re.I)
|
||||
_karmaRe = re.compile(r'^(?:\S+|\(.+\))(?:\+\+|--)(?:\s+)?$')
|
||||
def doPrivmsg(self, irc, msg):
|
||||
if msg.repliedTo:
|
||||
self.log.debug('Returning early from doPrivmsg, msg.repliedTo.')
|
||||
return
|
||||
try:
|
||||
if ircmsgs.isCtcp(msg):
|
||||
return
|
||||
@ -595,9 +598,6 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp):
|
||||
# Does the dunno'ing for us itself.
|
||||
self.factoid(key, prepend=random.choice(starts))
|
||||
|
||||
def invalidCommand(self, irc, msg, tokens):
|
||||
irc.finished = True
|
||||
|
||||
def doFactoid(self, irc, msg, match):
|
||||
r"^(.+?)\s+(?<!\\)(was|is|am|were|are)\s+(also\s+)?(.+?)[?!. ]*$"
|
||||
(key, isAre, also, value) = match.groups()
|
||||
|
@ -184,6 +184,9 @@ class SnarfIrc(object):
|
||||
def urlSnarfer(f):
|
||||
"""Protects the snarfer from loops and whatnot."""
|
||||
def newf(self, irc, msg, match, *L, **kwargs):
|
||||
if msg.repliedTo:
|
||||
self.log.debug('Not calling snarfer, msg is already repliedTo.')
|
||||
return
|
||||
channel = msg.args[0]
|
||||
if not ircutils.isChannel(channel):
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user