From b579d19beae6f92c5a53f110a3031a4e172d3aec Mon Sep 17 00:00:00 2001 From: Numerlor Date: Wed, 2 Oct 2019 18:24:45 +0200 Subject: put role bypass check above channel override to make sure bypass roles can activate commands everywhere even with override channels specified --- bot/decorators.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bot/decorators.py b/bot/decorators.py index 2c042b56..58f67a15 100644 --- a/bot/decorators.py +++ b/bot/decorators.py @@ -81,6 +81,13 @@ def in_channel_check(*channels: int, bypass_roles: typing.Container[int] = None) ) return True + if bypass_roles and any(r.id in bypass_roles for r in ctx.author.roles): + log.debug( + f"{ctx.author} called the '{ctx.command.name}' command and " + f"had a role to bypass the in_channel check." + ) + return True + if hasattr(ctx.command.callback, "in_channel_override"): override = ctx.command.callback.in_channel_override if override is None: @@ -106,13 +113,6 @@ def in_channel_check(*channels: int, bypass_roles: typing.Container[int] = None) f"Sorry, but you may only use this command within {channels_str}." ) - if bypass_roles and any(r.id in bypass_roles for r in ctx.author.roles): - log.debug( - f"{ctx.author} called the '{ctx.command.name}' command and " - f"had a role to bypass the in_channel check." - ) - return True - log.debug( f"{ctx.author} tried to call the '{ctx.command.name}' command. " f"The in_channel check failed." -- cgit v1.2.3 From 3c79d996ba17752d87cef5606131308ae34e388a Mon Sep 17 00:00:00 2001 From: Numerlor Date: Wed, 2 Oct 2019 21:01:46 +0200 Subject: adjust end date time to the end of the last day of october instead of the beginning of it --- bot/seasons/halloween/hacktoberstats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/seasons/halloween/hacktoberstats.py b/bot/seasons/halloween/hacktoberstats.py index 035eafbc..9ad44e3f 100644 --- a/bot/seasons/halloween/hacktoberstats.py +++ b/bot/seasons/halloween/hacktoberstats.py @@ -225,7 +225,7 @@ class HacktoberStats(commands.Cog): not_label = "invalid" action_type = "pr" is_query = f"public+author:{github_username}" - date_range = f"{CURRENT_YEAR}-10-01T00:00:00%2B14:00..{CURRENT_YEAR}-10-31T00:00:00-11:00" + date_range = f"{CURRENT_YEAR}-10-01T00:00:00%2B14:00..{CURRENT_YEAR}-10-31T23:59:59-11:00" per_page = "300" query_url = ( f"{base_url}" -- cgit v1.2.3