fix for hiatus
This commit is contained in:
parent
4d5a05614d
commit
c8b152e3fe
|
@ -16,23 +16,27 @@ def get_time(ep):
|
||||||
def when(inp, say=None):
|
def when(inp, say=None):
|
||||||
#"Shows the countdown to the new episode of My Little Pony: Friendship is Magic!"
|
#"Shows the countdown to the new episode of My Little Pony: Friendship is Magic!"
|
||||||
|
|
||||||
ep = ponyapi.newest()
|
try:
|
||||||
now, then, td = get_time(ep)
|
ep = ponyapi.newest()
|
||||||
seasonep = ""
|
now, then, td = get_time(ep)
|
||||||
|
seasonep = ""
|
||||||
|
|
||||||
if inp == "discord":
|
if inp == "discord":
|
||||||
return "%s will air on %s" % (ep[u"name"], DDate(then))
|
return "%s will air on %s" % (ep[u"name"], DDate(then))
|
||||||
|
|
||||||
if ep[u"is_movie"]:
|
if ep[u"is_movie"]:
|
||||||
seasonep = "(a movie)"
|
seasonep = "(a movie)"
|
||||||
else:
|
else:
|
||||||
seasonep = "(season %d episode %d)" % (ep[u"season"], ep[u"episode"])
|
seasonep = "(season %d episode %d)" % (ep[u"season"], ep[u"episode"])
|
||||||
|
|
||||||
reply = "%s %s will air on %s in %d days!" % (
|
reply = "%s %s will air on %s in %d days!" % (
|
||||||
ep[u"name"], seasonep, then.strftime("%a, %d %b %Y %H:%M:%S"),
|
ep[u"name"], seasonep, then.strftime("%a, %d %b %Y %H:%M:%S"),
|
||||||
td.days)
|
td.days)
|
||||||
|
|
||||||
return reply
|
return reply
|
||||||
|
|
||||||
|
except:
|
||||||
|
return "404! We're on hiatus!"
|
||||||
|
|
||||||
@hook.command
|
@hook.command
|
||||||
def randomep(inp):
|
def randomep(inp):
|
||||||
|
|
Loading…
Reference in New Issue