switch to requests for HTTP queries
This commit is contained in:
@@ -4,16 +4,16 @@ commit.py - what the commit
|
||||
author: mutantmonkey <mutantmonkey@mutantmonkey.in>
|
||||
"""
|
||||
|
||||
from urllib.error import HTTPError
|
||||
import web
|
||||
from tools import GrumbleError
|
||||
|
||||
|
||||
def commit(phenny, input):
|
||||
""".commit - Get a What the Commit commit message."""
|
||||
|
||||
try:
|
||||
msg = web.get("http://whatthecommit.com/index.txt")
|
||||
except (HTTPError, IOError, ValueError):
|
||||
except:
|
||||
raise GrumbleError("THE INTERNET IS FUCKING BROKEN. Please try again later.")
|
||||
|
||||
phenny.reply(msg)
|
||||
|
||||
Reference in New Issue
Block a user