Handle wrong usernames
This commit is contained in:
parent
56dcbb9a3d
commit
1cbaf43fe6
1 changed files with 16 additions and 13 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue