From 21e1d882b41e55ebf1a18795446079182904c621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Bagi=C5=84ski?= Date: Sun, 1 Oct 2023 16:00:30 +0200 Subject: [PATCH 1/2] changed autoposting from meta-editing to AI safety questions channel --- modules/questions.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/questions.py b/modules/questions.py index e41272c..bc04760 100644 --- a/modules/questions.py +++ b/modules/questions.py @@ -44,7 +44,7 @@ from config import coda_api_token, is_rob_server from servicemodules.discordConstants import ( general_channel_id, - meta_editing_channel_id, + ai_safety_questions_channel_id, ) from modules.module import Module, Response from utilities.utilities import ( @@ -421,9 +421,10 @@ def is_time_for_autopost_wip(self) -> bool: != now.date() # Wasn't posted today yet ) - async def last_msg_in_meta_editing_was_autoposted(self) -> bool: + async def last_msg_in_ai_safety_questions_was_autoposted(self) -> bool: channel = cast( - TextChannel, self.utils.client.get_channel(int(meta_editing_channel_id)) + TextChannel, + self.utils.client.get_channel(int(ai_safety_questions_channel_id)), ) async for msg in channel.history(limit=1): if msg.content.startswith(self.AUTOPOST_STAGNANT_MSG_PREFIX): @@ -436,7 +437,7 @@ async def autopost_wip(self) -> None: today = date.today() self.last_wip_autopost_attempt_date = today - if await self.last_msg_in_meta_editing_was_autoposted(): + if await self.last_msg_in_ai_safety_questions_was_autoposted(): self.log.info( self.class_name, msg="Last message in `#meta-editing` was one or more autoposted WIP question(s) -> skipping autoposting", @@ -475,7 +476,8 @@ async def autopost_wip(self) -> None: self.coda_api.last_question_id = questions[0]["id"] channel = cast( - TextChannel, self.utils.client.get_channel(int(meta_editing_channel_id)) + TextChannel, + self.utils.client.get_channel(int(ai_safety_questions_channel_id)), ) current_time = datetime.now() msg = self.AUTOPOST_STAGNANT_MSG_PREFIX + "\n\n" From 9790d7c12c191057eefc0401258efc6e21838d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Bagi=C5=84ski?= Date: Sun, 1 Oct 2023 16:03:22 +0200 Subject: [PATCH 2/2] no autoposting to work-in-progress questions on wednesday --- modules/questions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/questions.py b/modules/questions.py index bc04760..8996091 100644 --- a/modules/questions.py +++ b/modules/questions.py @@ -415,7 +415,7 @@ async def autopost_not_started(self) -> None: def is_time_for_autopost_wip(self) -> bool: now = datetime.now() return ( - now.weekday() in (0, 2, 4) # Monday, Wednesday, or Friday + now.weekday() in (0, 4) # Monday or Friday and 8 <= now.hour <= 12 # between 08:00 and 12:00 and self.last_wip_autopost_attempt_date != now.date() # Wasn't posted today yet