diff options
author | 2021-11-01 21:16:20 +0000 | |
---|---|---|
committer | 2021-11-01 21:21:43 +0000 | |
commit | ea8f5562bdf0c855990bffd72d7f99d5d2f31ad8 (patch) | |
tree | 0ca9ec0991f7f268b0776702d8234fd4fd44edc9 | |
parent | Address Reviews (diff) |
Address Reviews V2
-rw-r--r-- | bot/exts/events/hacktoberfest/_cog.py | 4 | ||||
-rw-r--r-- | bot/exts/events/hacktoberfest/_utils.py | 25 |
2 files changed, 15 insertions, 14 deletions
diff --git a/bot/exts/events/hacktoberfest/_cog.py b/bot/exts/events/hacktoberfest/_cog.py index d4733bf6..33b357d1 100644 --- a/bot/exts/events/hacktoberfest/_cog.py +++ b/bot/exts/events/hacktoberfest/_cog.py @@ -72,9 +72,9 @@ class Hacktoberfest(commands.Cog): ) await ctx.send(msg) return - log.info(f"Getting stats for {author_id} linked GitHub account '{github_username}'") + log.info(f"Getting stats for {author_id}'s linked GitHub account: '{github_username}'") else: - log.info(f"Getting stats for '{github_username} as requested by {ctx.author.id}") + log.info(f"Getting stats for '{github_username}' as requested by {ctx.author.id}") await utils.get_stats(ctx, github_username) @in_month(Month.SEPTEMBER, Month.OCTOBER, Month.NOVEMBER) diff --git a/bot/exts/events/hacktoberfest/_utils.py b/bot/exts/events/hacktoberfest/_utils.py index 6756bc9d..4fe2b82c 100644 --- a/bot/exts/events/hacktoberfest/_utils.py +++ b/bot/exts/events/hacktoberfest/_utils.py @@ -42,12 +42,12 @@ GITHUB_NONEXISTENT_USER_MESSAGE = ( URL = ( "https://api.github.com/search/issues?" # base url - "per_page=100" # limit results per-page returned by API to 100 (the maximum) - "&q=" # add query parameters - "is:issue+" # is an issue... - "state:open+" # ...that's open... - "label:hacktoberfest+" # ...with the `hacktoberfest` label... - "language:python" # ...and in Python. + "per_page=100" # limit results per-page returned by API to 100 (the maximum) + "&q=" # add query parameters + "is:issue+" # is an issue + "state:open+" # that's open + "label:hacktoberfest+" # with the `hacktoberfest` label... + "language:python" # in Python. ) @@ -173,12 +173,13 @@ async def get_october_prs(bot: Bot, github_username: str) -> Optional[list[dict] log.info(f"Fetching Hacktoberfest Stats for GitHub user: '{github_username}'") base_url = "https://api.github.com/search/issues" + hacktoberfest_timeframe = f"{CURRENT_YEAR} - 09 - 30T10: 00Z..{CURRENT_YEAR} - 11 - 01T12: 00Z" query_params = ( - f"+type:pr" # Only get PR if it's: - f"+is:public" # - public,... - f"+author:{quote_plus(github_username)}" # - by the user's github username,... - f"+-is:draft" # - not a draft... - f"+created:{CURRENT_YEAR}-09-30T10:00Z..{CURRENT_YEAR}-11-01T12:00Z" # and made in october. + f"+type:pr" # Only get PR if it's: + f"+is:public" # - public + f"+author:{quote_plus(github_username)}" # - by the user's github username + f"+-is:draft" # - not a draft + f"+created:{hacktoberfest_timeframe}" # - made within hacktoberfest. f"&per_page=100" # Limit results per-page returned from API (100 is the maximum) ) @@ -330,7 +331,7 @@ async def categorize_prs(bot: Bot, prs: list[dict]) -> tuple[list[dict], list[di are 'accepted' (after 14 days review period). PRs that are accepted must either be merged, approved, or labelled - 'hacktoberfest-accepted. + 'hacktoberfest-accepted'. """ now = datetime.now() in_review = [] |