ctx.message is None
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 13s

This commit is contained in:
Nexus 2024-05-03 20:27:02 +01:00
parent 2b99f83db3
commit b8d1fbea92
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -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,