From 44825f97ea399fc077ec2d964d1a6c9da2069fed Mon Sep 17 00:00:00 2001 From: sco1 Date: Tue, 20 Nov 2018 15:45:53 -0500 Subject: Add typing context manager where appropriate Some minor syntax & logic fixes where noticed --- bot/cogs/hacktober/hacktoberstats.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'bot/cogs/hacktober/hacktoberstats.py') 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: """ -- cgit v1.2.3