added timeout to isup.py, made -m work for .pickmovie, fixed xkcd.py

This commit is contained in:
iou1name 2018-04-24 20:07:25 -04:00
parent c3820a445d
commit ff4c71253c
3 changed files with 4 additions and 4 deletions

View File

@ -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.")

View File

@ -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):

View File

@ -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()