aboutsummaryrefslogtreecommitdiffstats
path: root/bot/seasons
diff options
context:
space:
mode:
Diffstat (limited to 'bot/seasons')
-rw-r--r--bot/seasons/christmas/adventofcode.py2
-rw-r--r--bot/seasons/evergreen/issues.py2
-rw-r--r--bot/seasons/halloween/hacktoberstats.py9
3 files changed, 9 insertions, 4 deletions
diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py
index 6609387e..513c1020 100644
--- a/bot/seasons/christmas/adventofcode.py
+++ b/bot/seasons/christmas/adventofcode.py
@@ -126,7 +126,7 @@ class AdventOfCode(commands.Cog):
self.status_task = asyncio.ensure_future(self.bot.loop.create_task(status_coro))
@commands.group(name="adventofcode", aliases=("aoc",), invoke_without_command=True)
- @override_in_channel
+ @override_in_channel()
async def adventofcode_group(self, ctx: commands.Context) -> None:
"""All of the Advent of Code commands."""
await ctx.send_help(ctx.command)
diff --git a/bot/seasons/evergreen/issues.py b/bot/seasons/evergreen/issues.py
index 0ba74d9c..438ab475 100644
--- a/bot/seasons/evergreen/issues.py
+++ b/bot/seasons/evergreen/issues.py
@@ -16,7 +16,7 @@ class Issues(commands.Cog):
self.bot = bot
@commands.command(aliases=("issues",))
- @override_in_channel
+ @override_in_channel()
async def issue(
self, ctx: commands.Context, number: int, repository: str = "seasonalbot", user: str = "python-discord"
) -> None:
diff --git a/bot/seasons/halloween/hacktoberstats.py b/bot/seasons/halloween/hacktoberstats.py
index 20797037..035eafbc 100644
--- a/bot/seasons/halloween/hacktoberstats.py
+++ b/bot/seasons/halloween/hacktoberstats.py
@@ -10,12 +10,16 @@ import aiohttp
import discord
from discord.ext import commands
+from bot.constants import Channels, WHITELISTED_CHANNELS
+from bot.decorators import override_in_channel
from bot.utils.persist import make_persistent
+
log = logging.getLogger(__name__)
CURRENT_YEAR = datetime.now().year # Used to construct GH API query
PRS_FOR_SHIRT = 4 # Minimum number of PRs before a shirt is awarded
+HACKTOBER_WHITELIST = WHITELISTED_CHANNELS + (Channels.hacktoberfest_2019,)
class HacktoberStats(commands.Cog):
@@ -27,6 +31,7 @@ class HacktoberStats(commands.Cog):
self.linked_accounts = self.load_linked_users()
@commands.group(name="hacktoberstats", aliases=("hackstats",), invoke_without_command=True)
+ @override_in_channel(HACKTOBER_WHITELIST)
async def hacktoberstats_group(self, ctx: commands.Context, github_username: str = None) -> None:
"""
Display an embed for a user's Hacktoberfest contributions.
@@ -220,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-01..{CURRENT_YEAR}-10-31"
+ date_range = f"{CURRENT_YEAR}-10-01T00:00:00%2B14:00..{CURRENT_YEAR}-10-31T00:00:00-11:00"
per_page = "300"
query_url = (
f"{base_url}"
@@ -231,7 +236,7 @@ class HacktoberStats(commands.Cog):
f"&per_page={per_page}"
)
- headers = {"user-agent": "Discord Python Hactoberbot"}
+ headers = {"user-agent": "Discord Python Hacktoberbot"}
async with aiohttp.ClientSession() as session:
async with session.get(query_url, headers=headers) as resp:
jsonresp = await resp.json()