aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjun Satarkar <me@arjunsatarkar.net>2023-12-24 08:14:22 +0000
committerArjun Satarkar <me@arjunsatarkar.net>2023-12-24 08:15:35 +0000
commit7ae6d4d2905b48c9bc566818396dd5f877156b3d (patch)
treec2c92834098920c8bdcd2b33ceff806ec1183543
parent009a6edd64f890cf3a900e61c84b195a39f48cef (diff)
downloadaps-cogs-7ae6d4d2905b48c9bc566818396dd5f877156b3d.tar
aps-cogs-7ae6d4d2905b48c9bc566818396dd5f877156b3d.tar.gz
aps-cogs-7ae6d4d2905b48c9bc566818396dd5f877156b3d.zip
question_of_the_day: actually check if enabled before posting 😓
-rw-r--r--question_of_the_day/question_of_the_day.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/question_of_the_day/question_of_the_day.py b/question_of_the_day/question_of_the_day.py
index 9f4af07..3ad8472 100644
--- a/question_of_the_day/question_of_the_day.py
+++ b/question_of_the_day/question_of_the_day.py
@@ -50,13 +50,14 @@ class QuestionOfTheDay(commands.Cog):
for guild_id in guilds_due:
guild = await self.bot.fetch_guild(int(guild_id))
- channel_id = await self.config.guild(guild).post_in_channel()
- if not channel_id:
- self.logger.info(
- f"QOTD was due for guild {guild.name} ({guild_id}) but no channel was set, so it was not posted."
- )
- channel = await guild.fetch_channel(channel_id)
- await self.send_question_to_channel(channel)
+ if await self.config.guild(guild).enabled():
+ channel_id = await self.config.guild(guild).post_in_channel()
+ if not channel_id:
+ self.logger.info(
+ f"QOTD was due for guild {guild.name} ({guild_id}) but no channel was set, so it was not posted."
+ )
+ channel = await guild.fetch_channel(channel_id)
+ await self.send_question_to_channel(channel)
current_time = time.time()