aboutsummaryrefslogtreecommitdiffstats
path: root/bot/seasons/halloween/hacktoberstats.py
diff options
context:
space:
mode:
authorGravatar scragly <[email protected]>2019-09-19 22:59:46 +1000
committerGravatar scragly <[email protected]>2019-09-19 22:59:46 +1000
commitf91d49d987065df43cbaa8264d349885f001aa17 (patch)
tree4f44b8729a19c4020651e261cbda524a7884d87b /bot/seasons/halloween/hacktoberstats.py
parentPrevent empty JSON raising an exception. (diff)
Add persistent datafile utils.
Diffstat (limited to 'bot/seasons/halloween/hacktoberstats.py')
-rw-r--r--bot/seasons/halloween/hacktoberstats.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/seasons/halloween/hacktoberstats.py b/bot/seasons/halloween/hacktoberstats.py
index 0f513953..9dfb20bd 100644
--- a/bot/seasons/halloween/hacktoberstats.py
+++ b/bot/seasons/halloween/hacktoberstats.py
@@ -10,6 +10,8 @@ import aiohttp
import discord
from discord.ext import commands
+from bot.utils.persist import datafile
+
log = logging.getLogger(__name__)
CURRENT_YEAR = datetime.now().year # Used to construct GH API query
@@ -21,7 +23,7 @@ class HacktoberStats(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
- self.link_json = Path("bot/resources/github_links.json")
+ self.link_json = datafile(Path("bot", "resources", "halloween", "github_links.json"))
self.linked_accounts = self.load_linked_users()
@commands.group(name="hacktoberstats", aliases=("hackstats",), invoke_without_command=True)