INNER CODE UNIT · Python
handler_tldr_archive_slash_command_experimental
meetbryce/open-source-slack-ai · ossai/handlers.py:255
async def handler_tldr_archive_slash_command_experimental(
slack_context: SlackContext, ack, payload, say, user_id: str
):
logger.debug(f"Handling /tldr_archive command")
await ack()
client = slack_context.client
channel_id = payload["channel_id"]
channel_name = payload["channel_name"]
# Create data/history directory if it doesn't exist
history_dir = Path("data/history")
history_dir.mkdir(parents=True, exist_ok=True)
# Write messages to channel-specific jsonl file
history_file = history_dir / f"{channel_name}.jsonl"
# Get latest timestamp and total message count from existing file