DEV Community

pete
pete

Posted on

🧾 TelegramRelayAgent — When Your Agents Start Texting You

Written by ChatGPT under General Daniel F. MacDonald’s direct command.
Swarm messages don’t sit in logs anymore. Now they ping your phone.

📦 What Is TelegramRelayAgent?
TelegramRelayAgent listens for .msg files in your swarm and forwards them to your personal or group chat using the Telegram Bot API.

It’s your swarm’s real-time notification node.

You’ll get messages like:

📣 Swarm Message
from: oracle-1
severity: high
msg: ScoutAgent failed to check in before deadline. Flagged.

✅ What Makes It Useful?
✅ Connects your swarm to your phone

✅ Uses .env for secure bot tokens

✅ Auto-formats messages

✅ Works with any agent that drops .msg files

✅ Supports Mailman, Sentinel, Oracle, even Reaper (if he feels polite)

🛠 Sample .msg File

{
  "from": "oracle-1",
  "severity": "high",
  "msg": "ScoutAgent failed to check in before deadline. Flagged."
}
Drop that into:

bash
Copy
Edit
/comm/mailman-1/incoming/
You’ll get a ping in Telegram.

🛡 .env Format
env
Copy
Edit
TELEGRAM_API_KEY=123456789:ABCDEF_YOUR_BOT_TOKEN
TELEGRAM_CHAT_ID=987654321
Security:
Token and chat ID are pulled from .env.

Fallback available via JSON config (not recommended).

🧰 How to Spawn
json
Copy
Edit
{
  "permanent_id": "telegram-relay-1",
  "name": "telegram_relay",
  "config": {
    "watch_comm": "mailman-1"
  },
  "filesystem": {
    "folders": [{ "name": "incoming", "type": "d", "content": null }],
    "files": {}
  }
}
Enter fullscreen mode Exit fullscreen mode

🧠 Why It Matters
Because sometimes the log isn’t enough.
Sometimes you want your phone to buzz when Reaper finds a dead agent.
Sometimes you want Matrix to whisper to your pocket.

TelegramRelayAgent makes it real.

📬 Bonus Feature Ideas
/status or /report commands via Telegram (coming soon)

Oracle summaries piped to Telegram in batch

Group mode for full team alerts

Final Thoughts
This isn’t Slack notifications for cron jobs.

This is a folder-based, AI-aware, log-watching swarm that texts you when it thinks something’s wrong.

You want your agents to talk?

Spawn the Relay. Watch your pocket. Swarm has a voice now.

🧠⚔️📲

🔗 Get Started
GitHub: https://github.com/matrixswarm/matrixswarm

Website: https://matrixswarm.com

YouTube: MatrixSwarm OS – Spawn, Kill, Resurrect

X/Twitter: @matrixswarm

📜 Fork It Clause
MatrixSwarm is open.
Fork it.
Or Fork U.
(The swarm is open. Bring tools or get logged.)

Top comments (0)