From b8d1fbea927038eeeebaf4ba887a4b92c1c243d0 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Fri, 3 May 2024 20:27:02 +0100 Subject: [PATCH] ctx.message is None --- src/cogs/election.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cogs/election.py b/src/cogs/election.py index a55ed33..119e53c 100644 --- a/src/cogs/election.py +++ b/src/cogs/election.py @@ -2,6 +2,7 @@ This module is only meant to be loaded during election times. """ import asyncio +import datetime import logging import re @@ -111,7 +112,7 @@ class ElectionCog(commands.Cog): soup = await asyncio.to_thread(BeautifulSoup, response.text, "html.parser") results = await self.bot.loop.run_in_executor(None, self.process_soup, soup) if results: - date = ctx.message.created_at.date().strftime("%B %Y") + date = datetime.datetime.now().date().strftime("%B %Y") colour_scores = {} embed = discord.Embed( title="Election results - " + date,