1
0
Fork 0
mirror of synced 2024-04-28 01:32:23 +12:00

Handle wrong usernames

This commit is contained in:
Dan Hess 2021-04-01 14:21:51 -08:00
parent 56dcbb9a3d
commit 1cbaf43fe6

View file

@ -77,6 +77,7 @@ query ($name: String) {
# Anilist API is broken and doesn't filter correctly, guess we have to do that ourselves
data = []
try:
for x in response["data"]["MediaListCollection"]["lists"]:
data.extend(
[
@ -90,6 +91,8 @@ query ($name: String) {
if r["media"]["status"] == "FINISHED"
]
)
except TypeError:
return await ctx.send("Can't find an anilist with that username!")
# Filtering done, sort it
data = sorted(