Compare commits
1 Commits
ce55e2eed3
...
4df0b281d6
Author | SHA1 | Date | |
---|---|---|---|
4df0b281d6 |
|
@ -27,16 +27,11 @@ def isup(bot, trigger):
|
||||||
return bot.msg("Missing or invalid schema. Check the URL.")
|
return bot.msg("Missing or invalid schema. Check the URL.")
|
||||||
|
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
return bot.msg("\x0304Connection error\x03. Are you sure this is " + \
|
return bot.msg("Connection error. Are you sure this is a real website?")
|
||||||
"a real website?")
|
|
||||||
|
|
||||||
except requests.exceptions.InvalidURL:
|
except requests.exceptions.InvalidURL:
|
||||||
return bot.msg("Invalid URL.")
|
return bot.msg("Invalid URL.")
|
||||||
|
|
||||||
except requests.exceptions.ReadTimeout:
|
|
||||||
return bot.msg("\x0307" + url + "\x03 looks \x0304down\x03 from " + \
|
|
||||||
"here (\x0304Timed out [10s]\x03)")
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
return bot.msg("Listen buddy. I don't know what you're doing, but " + \
|
return bot.msg("Listen buddy. I don't know what you're doing, but " + \
|
||||||
|
@ -44,6 +39,6 @@ def isup(bot, trigger):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
res.raise_for_status()
|
res.raise_for_status()
|
||||||
return bot.msg("\x0307" + url + "\x03 looks \x0303up\x03 from here.")
|
return bot.msg(url + " appears to be working from here.")
|
||||||
except requests.exceptions.HTTPError:
|
except requests.exceptions.HTTPError:
|
||||||
return bot.msg("\x0307" + url + "\x03 looks \x0304down\x03 from here.")
|
return bot.msg(url + " looks down from here.")
|
||||||
|
|
|
@ -106,7 +106,7 @@ def watch(bot, trigger):
|
||||||
bot.memory["watcher"][url] = t
|
bot.memory["watcher"][url] = t
|
||||||
|
|
||||||
bot.db.execute("INSERT INTO watcher(api_url, name, last_post, time_since)"
|
bot.db.execute("INSERT INTO watcher(api_url, name, last_post, time_since)"
|
||||||
" VALUES(?,?,?,?)", (api_url, name, last_post, time_since))
|
" VALUES(?,?,?,?,?)", (api_url, name, last_post, time_since))
|
||||||
|
|
||||||
bot.msg("[\x0304Watcher\x03] Watching thread: \x0307" + url)
|
bot.msg("[\x0304Watcher\x03] Watching thread: \x0307" + url)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user