look back in logs for URL when non is provided to !isup
This commit is contained in:
parent
15782908db
commit
ee64bfc5fc
1 changed files with 10 additions and 2 deletions
|
@ -5,11 +5,19 @@ class Module(ModuleManager.BaseModule):
|
|||
_name = "isup"
|
||||
|
||||
@utils.hook("received.command.isup")
|
||||
@utils.kwarg("min_args", 1)
|
||||
@utils.kwarg("help", "Check if a given URL is up or not")
|
||||
@utils.kwarg("usage", "<url>")
|
||||
def isup(self, event):
|
||||
url = None
|
||||
if event["args"]:
|
||||
url = event["args_split"][0]
|
||||
else:
|
||||
match = event["target"].buffer.find(utils.http.REGEX_URL)
|
||||
if match:
|
||||
url = match.match
|
||||
|
||||
if not url:
|
||||
raise utils.EventError("No URL provided/found.")
|
||||
|
||||
response = None
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue