Change error on invalid meme format
This commit is contained in:
parent
fd588cffee
commit
3759e19145
|
@ -26,7 +26,10 @@ def memegen(bot,channel,nick,template,*msg):
|
|||
if "://" in template: # URL
|
||||
bot.say(channel,"{}: https://memegen.link/custom/{}/{}.jpg?alt={}".format(nick,top,bottom,template))
|
||||
else:
|
||||
r = requests.get("https://memegen.link/{}/{}/{}".format(template,top,bottom))
|
||||
r.raise_for_status()
|
||||
r = r.json()
|
||||
bot.say(channel,"{}: {}".format(nick,r["direct"]["masked"]))
|
||||
try:
|
||||
r = requests.get("https://memegen.link/{}/{}/{}".format(template,top,bottom))
|
||||
r.raise_for_status()
|
||||
r = r.json()
|
||||
bot.say(channel,"{}: {}".format(nick,r["direct"]["masked"]))
|
||||
except requests.exceptions.HTTPError:
|
||||
bot.say(channel,"ACCESS VIOLATION: Cannot find meme format {}.".format(template))
|
||||
|
|
Loading…
Reference in New Issue