Files
claude-config/bin/agent_cycle/direct_message.py
T

9 lines
534 B
Python

from loop_effects.effects import Effects, say
def tell(text: str, effects: Effects, directory: str | None = None) -> bool:
"""DMs text to the human through the notifier of the project whose checkout holds directory, else the current directory, and returns whether it went out. Where the DM fails, it says why on stderr and goes on: the DM only copies what the terminal shows, so its failure never stops the loop."""
if failed := effects.dm(text, directory):
say(f"could not DM you: {failed.reason}", effects)
return not failed