mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-22 23:36:36 +00:00
IrcMiRCARTBot.py:_dispatchPrivmsg(): print message from website if upload fails.
IrcMiRCARTBot.py:_uploadToImgur(): additionally return responseHttp.text on failure.
This commit is contained in:
parent
5f99672c08
commit
e7b6324866
@ -163,7 +163,9 @@ class IrcMiRCARTBot(IrcClient.IrcClient):
|
||||
self.clientLastMessage = int(time.time())
|
||||
else:
|
||||
self._log("Upload failed with HTTP status code {}".format(imgurResponse[0]))
|
||||
self._log("Message from website: {}".format(imgurResponse[1]))
|
||||
self.queue("PRIVMSG", message[2], "4/!\\ Upload failed with HTTP status code {}!".format(imgurResponse[0]))
|
||||
self.queue("PRIVMSG", message[2], "4/!\\ Message from website: {}".format(imgurResponse[1]))
|
||||
if os.path.isfile(asciiTmpFilePath):
|
||||
os.remove(asciiTmpFilePath)
|
||||
if os.path.isfile(imgTmpFilePath):
|
||||
@ -197,7 +199,7 @@ class IrcMiRCARTBot(IrcClient.IrcClient):
|
||||
if responseHttp.status_code == 200:
|
||||
return [200, responseDict.get("data").get("link")]
|
||||
else:
|
||||
return [responseHttp.status_code]
|
||||
return [responseHttp.status_code, responseHttp.text]
|
||||
# }}}
|
||||
# {{{ _urlretrieveReportHook(count, blockSize, totalSize): Limit downloads to 1 MB
|
||||
def _urlretrieveReportHook(count, blockSize, totalSize):
|
||||
|
Loading…
Reference in New Issue
Block a user