diff options
author | 2018-11-21 13:00:34 +0100 | |
---|---|---|
committer | 2018-11-21 13:00:34 +0100 | |
commit | 276348d1e6524f895c8427d36b611b27258f369a (patch) | |
tree | 7e5e6153b02737624e8b78f932cc15488f3810c4 /bot/cogs/hacktober/hacktoberstats.py | |
parent | Merge branch 'markylon-gif' (diff) | |
parent | Resolve Flake8 (diff) |
Merge pull request #69 from python-discord/issue/68-with-typing
Typing context manager for Hacktober cogs
Diffstat (limited to 'bot/cogs/hacktober/hacktoberstats.py')
-rw-r--r-- | bot/cogs/hacktober/hacktoberstats.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bot/cogs/hacktober/hacktoberstats.py b/bot/cogs/hacktober/hacktoberstats.py index 0755503c..c473d3d0 100644 --- a/bot/cogs/hacktober/hacktoberstats.py +++ b/bot/cogs/hacktober/hacktoberstats.py @@ -148,13 +148,14 @@ class Stats: Otherwise, post a helpful error message """ - prs = await self.get_october_prs(github_username) + async with ctx.typing(): + prs = await self.get_october_prs(github_username) - if prs: - stats_embed = self.build_embed(github_username, prs) - await ctx.send('Here are some stats!', embed=stats_embed) - else: - await ctx.send(f"No October GitHub contributions found for '{github_username}'") + if prs: + stats_embed = self.build_embed(github_username, prs) + await ctx.send('Here are some stats!', embed=stats_embed) + else: + await ctx.send(f"No October GitHub contributions found for '{github_username}'") def build_embed(self, github_username: str, prs: typing.List[dict]) -> discord.Embed: """ |