aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/cogs/reddit.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/cogs/reddit.py b/bot/cogs/reddit.py
index 083f90573..d9e1f0a39 100644
--- a/bot/cogs/reddit.py
+++ b/bot/cogs/reddit.py
@@ -18,6 +18,8 @@ from bot.pagination import LinePaginator
log = logging.getLogger(__name__)
+AccessToken = namedtuple("AccessToken", ["token", "expires_at"])
+
class Reddit(Cog):
"""Track subreddit posts and show detailed statistics about them."""
@@ -73,7 +75,6 @@ class Reddit(Cog):
if response.status == 200 and response.content_type == "application/json":
content = await response.json()
expiration = int(content["expires_in"]) - 60 # Subtract 1 minute for leeway.
- AccessToken = namedtuple("AccessToken", ["token", "expires_at"])
self.access_token = AccessToken(
token=content["access_token"],
expires_at=datetime.utcnow() + timedelta(seconds=expiration)