generated from nhcarrigan/template
docs: add data file documentation and fix data path resolution
All Python cohort scripts now use DATA_DIR = Path(__file__).parent.parent.parent / "data" to correctly resolve the repo-root data/ directory regardless of the working directory set by run.sh. All TypeScript scripts have expanded JSDoc headers documenting data file requirements and environment variables.
This commit is contained in:
@@ -1,11 +1,25 @@
|
||||
"""Send check-in messages to all team channels."""
|
||||
"""Send biweekly check-in messages to all team Discord channels.
|
||||
|
||||
Posts a check-in prompt to each team channel and automatically creates a thread
|
||||
for responses. Members who do not respond by the deadline may be removed for
|
||||
inactivity.
|
||||
|
||||
Data files (place in data/):
|
||||
- team_message_ids.json Channel IDs per team (generated by send_team_messages.py)
|
||||
|
||||
Env vars:
|
||||
- DISCORD_BOT_TOKEN Bot token for the Discord API
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import aiohttp
|
||||
|
||||
DATA_DIR = Path(__file__).parent.parent.parent / "data"
|
||||
|
||||
DISCORD_BOT_TOKEN = os.environ["DISCORD_BOT_TOKEN"]
|
||||
DISCORD_API = "https://discord.com/api/v10"
|
||||
GUILD_ID = "692816967895220344"
|
||||
@@ -22,7 +36,7 @@ CHECK_IN_MESSAGE = """@everyone it is time for Naomi to do a check in. I need **
|
||||
|
||||
async def send_checkin_to_teams() -> None:
|
||||
"""Send check-in message to all team channels (except Jade Jasmine)."""
|
||||
with open("team_message_ids.json") as f:
|
||||
with open(DATA_DIR / "team_message_ids.json") as f:
|
||||
team_data = json.load(f)
|
||||
|
||||
headers = {
|
||||
|
||||
Reference in New Issue
Block a user