From ff4c71253c7a5ebd0ea6cc9393bca6e38c52d35c Mon Sep 17 00:00:00 2001 From: iou1name Date: Tue, 24 Apr 2018 20:07:25 -0400 Subject: [PATCH] added timeout to isup.py, made -m work for .pickmovie, fixed xkcd.py --- modules/isup.py | 2 +- modules/movie.py | 4 ++-- modules/xkcd.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/isup.py b/modules/isup.py index ecfd930..82a943d 100755 --- a/modules/isup.py +++ b/modules/isup.py @@ -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.") diff --git a/modules/movie.py b/modules/movie.py index 48c8258..1395c84 100755 --- a/modules/movie.py +++ b/modules/movie.py @@ -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): diff --git a/modules/xkcd.py b/modules/xkcd.py index 55c4b3d..d2387b5 100755 --- a/modules/xkcd.py +++ b/modules/xkcd.py @@ -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()