web.isgd() now throws an error when it cant shorten a URL
This commit is contained in:
parent
28345b9c56
commit
72ed3c504f
5 changed files with 36 additions and 15 deletions
|
@ -6,5 +6,9 @@ from util import hook, web, http
|
|||
def lmgtfy(inp, bot=None):
|
||||
"lmgtfy [phrase] - Posts a google link for the specified phrase"
|
||||
|
||||
url = "http://lmgtfy.com/?q=%s" % http.quote_plus(inp)
|
||||
return web.isgd(url)
|
||||
link = "http://lmgtfy.com/?q=%s" % http.quote_plus(inp)
|
||||
|
||||
try:
|
||||
return web.isgd(link)
|
||||
except (web.ShortenError, http.HTTPError):
|
||||
return link
|
||||
|
|
Reference in a new issue