mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 04:32:36 +01:00
Added a callCommand to the Web plugin to catch utils.web.Error.
This commit is contained in:
parent
1cc969b290
commit
a2e2063d8b
@ -40,6 +40,12 @@ class Web(callbacks.PluginRegexp):
|
||||
"""Add the help for "@help Web" here."""
|
||||
regexps = ['titleSnarfer']
|
||||
threaded = True
|
||||
def callCommand(self, command, irc, msg, *args, **kwargs):
|
||||
try:
|
||||
super(Web, self).callCommand(command, irc, msg, *args, **kwargs)
|
||||
except utils.web.Error, e:
|
||||
irc.reply(str(e))
|
||||
|
||||
_titleRe = re.compile(r'<title>(.*?)</title>', re.I | re.S)
|
||||
def titleSnarfer(self, irc, msg, match):
|
||||
r"https?://[^\])>\s]+"
|
||||
|
Loading…
Reference in New Issue
Block a user