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