return empty list if user guilds are empty

This commit is contained in:
Jeremy Zhang 2018-02-16 19:46:04 +00:00
parent f447305b03
commit b516f8af3a

View File

@ -59,7 +59,10 @@ def get_user_guilds():
return req return req
def get_user_managed_servers(): def get_user_managed_servers():
guilds = json.loads(get_user_guilds()) fetched = get_user_guilds()
if not fetched:
return []
guilds = json.loads(fetched)
filtered = [] filtered = []
for guild in guilds: for guild in guilds:
permission = guild['permissions'] # Manage Server, Ban Members, Kick Members permission = guild['permissions'] # Manage Server, Ban Members, Kick Members