linx: deal with no URL provided

master
mutantmonkey 2011-12-12 02:10:51 -05:00
parent babaa9fb9f
commit 42c37857fa
1 changed files with 3 additions and 1 deletions

View File

@ -12,11 +12,13 @@ def linx(phenny, input):
""".linx <url> - Upload a URL to linx.li."""
url = input.group(2)
if not url:
phenny.reply("No URL provided. CAN I HAS?")
try:
req = web.post("http://linx.li/vtluug", {'url': url})
except (HTTPError, IOError):
phenny.say("THE INTERNET IS FUCKING BROKEN. Please try again later.")
phenny.reply("THE INTERNET IS FUCKING BROKEN. Please try again later.")
return
data = json.loads(req)