added timeout to isup.py, made -m work for .pickmovie, fixed xkcd.py
This commit is contained in:
parent
c3820a445d
commit
ff4c71253c
|
@ -21,7 +21,7 @@ def isup(bot, trigger):
|
|||
url = "http://" + url
|
||||
|
||||
try:
|
||||
res = requests.head(url, verify=True)
|
||||
res = requests.head(url, timeout=10, verify=True)
|
||||
except (requests.exceptions.MissingSchema,
|
||||
requests.exceptions.InvalidSchema):
|
||||
return bot.say("Missing or invalid schema. Check the URL.")
|
||||
|
|
|
@ -151,11 +151,11 @@ def pickMovie(bot, trigger):
|
|||
bot.reply(movie[0])
|
||||
|
||||
if trigger.group(2) == "-m":
|
||||
trigger.set_group(f".movie {movie}")
|
||||
trigger.set_group(f".movie {movie}", bot.config)
|
||||
movieInfo(bot, trigger)
|
||||
|
||||
|
||||
@require_admin
|
||||
# @require_admin
|
||||
@commands('addmovie')
|
||||
@example('.addmovie Gay Niggers From Outer Space')
|
||||
def addMovie(bot, trigger):
|
||||
|
|
|
@ -74,7 +74,7 @@ def get_url(bot, url):
|
|||
"""Callback for the URL module."""
|
||||
_, _, num = url.partition("xkcd.com/")
|
||||
try:
|
||||
num = int(num)
|
||||
num = int(num.replace("/", ""))
|
||||
except ValueError:
|
||||
return
|
||||
latest = get_info()
|
||||
|
|
Loading…
Reference in New Issue
Block a user