9 lines
614 B
Python
9 lines
614 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: true too where the DM is skipped, since the project's config names no notifier. 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
|