diff options
author | 2020-10-11 00:29:13 +0530 | |
---|---|---|
committer | 2020-10-11 00:29:13 +0530 | |
commit | d2e2143a2c1345f93a494314b0a9cc954d1ca957 (patch) | |
tree | 4cc151628468c3e6bb604e212c1d50e05503e587 /bot/exts/evergreen/githubinfo.py | |
parent | followers md fix (diff) |
reduced num of api calls by 1
Diffstat (limited to 'bot/exts/evergreen/githubinfo.py')
-rw-r--r-- | bot/exts/evergreen/githubinfo.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/exts/evergreen/githubinfo.py b/bot/exts/evergreen/githubinfo.py index c514d200..19ec382b 100644 --- a/bot/exts/evergreen/githubinfo.py +++ b/bot/exts/evergreen/githubinfo.py @@ -50,7 +50,7 @@ class GithubInfo(commands.Cog): orgs = [f"[{org['login']}](https://github.com/{org['login']})" for org in org_data] orgs_to_add = ' | '.join(orgs) - gists_data = await self.fetch_data(f"https://api.github.com/users/{username}/gists") + gists = user_data['public_gists'] # Forming blog link if user_data['blog'].startswith("http"): # Blog link is complete @@ -83,7 +83,7 @@ class GithubInfo(commands.Cog): embed.add_field(name="\u200b", value="\u200b") if user_data['type'] == "User": - embed.add_field(name="Gists", value=f"[{len(gists_data)}](https://gist.github.com/{username})") + embed.add_field(name="Gists", value=f"[{len(gists)}](https://gist.github.com/{username})") embed.add_field(name=f"Organization{'s' if len(orgs)!=1 else ''}", value=orgs_to_add if orgs else "No organizations") |