Skip to content

Commit

Permalink
changed autoposting from meta-editing to AI safety questions channel
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Bagiński committed Oct 1, 2023
1 parent 3d57364 commit 21e1d88
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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):
Expand All @@ -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",
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 21e1d88

Please sign in to comment.