aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/fun/game.py
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-08-23 21:50:40 +0100
committerGravatar Chris Lovering <[email protected]>2022-09-21 23:02:57 +0100
commit8fc2ff954fbdfead73825f13d95a876fea5588a3 (patch)
tree7915b736a4b44a8389002e862bb94d4899c36bda /bot/exts/fun/game.py
parentAdd dependabot config (diff)
Move init tasks to async cog_load functions
Diffstat (limited to 'bot/exts/fun/game.py')
-rw-r--r--bot/exts/fun/game.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/bot/exts/fun/game.py b/bot/exts/fun/game.py
index 56e6314f..4ed2e93e 100644
--- a/bot/exts/fun/game.py
+++ b/bot/exts/fun/game.py
@@ -185,9 +185,7 @@ class Games(Cog):
self.genres: dict[str, int] = {}
self.headers = BASE_HEADERS
- self.bot.loop.create_task(self.renew_access_token())
-
- async def renew_access_token(self) -> None:
+ async def cog_load(self) -> None:
"""Refeshes V4 access token a number of seconds before expiry. See `ACCESS_TOKEN_RENEWAL_WINDOW`."""
while True:
async with self.http_session.post(OAUTH_URL, params=OAUTH_PARAMS) as resp: