Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion engine/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@
ENV = ROOT / ".env"
# The operator-managed bot credential is shared by TRON worktrees. Keep the
# engine-local file first for standalone installs and tests.
MODES_ENV = ROOT.parents[2] / "tron-modes" / ".env"
def _modes_env() -> Path:
"""Find the shared modes env from either a checkout or an added worktree."""
for parent in ROOT.parents:
candidate = parent / "tron-modes" / ".env"
if candidate.exists():
return candidate
return ROOT.parents[2] / "tron-modes" / ".env"


MODES_ENV = _modes_env()
CHANNEL_ID = "1547918251651112971"
MESSAGE_URL = f"https://discord.com/api/v10/channels/{CHANNEL_ID}/messages"
_state = {"loaded": False, "token": None, "after": None}
Expand Down
Loading