From 1090928ab72e1f047fa10da4535996236f58fe78 Mon Sep 17 00:00:00 2001 From: Jacob Mathison Date: Sun, 31 May 2026 00:42:04 -0500 Subject: [PATCH] =?UTF-8?q?feat:=20add=20tools/discord.md=20(bot=20access,?= =?UTF-8?q?=20channel=20IDs,=20guild=20map,=20raw=20API);=20fix=20HEARTBEA?= =?UTF-8?q?T=20RSS=E2=86=92API=20for=20Gitea=20issues;=20sync=20all=20inde?= =?UTF-8?q?x=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +- llm.txt | 1 + manifest.json | 3 +- tools/README.md | 1 + tools/discord.md | 152 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 158 insertions(+), 2 deletions(-) create mode 100644 tools/discord.md diff --git a/README.md b/README.md index aa6a65d..36143b5 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,8 @@ llm-tools/ │ ├── local-llm.llm.md Local LLMs — Gemma-4-E4B (8080) + Gemma-4-26B (8081) │ ├── claude-cli.md Claude Code CLI reference │ ├── codex-cli.md OpenAI Codex CLI reference -│ └── cursor-cli.md Cursor IDE/CLI reference +│ ├── cursor-cli.md Cursor IDE/CLI reference +│ └── discord.md Discord bot — read/send channels, IDs, guild map │ ├── agents/ Per-agent configuration and notes │ ├── README.md diff --git a/llm.txt b/llm.txt index 535b4fe..7f9f3f7 100644 --- a/llm.txt +++ b/llm.txt @@ -35,6 +35,7 @@ New agent? Read documents/onboarding.md first — it sequences the full orientat claude-cli.md Claude Code CLI — commands, flags, MCP, local LLM usage codex-cli.md OpenAI Codex CLI — install, approval modes, AGENTS.md cursor-cli.md Cursor IDE/CLI — agent mode, rules, MCP, Gitea integration + discord.md Discord bot — read/send channels, guild/channel IDs, raw API agents/ Per-agent configuration, context, and notes README.md diff --git a/manifest.json b/manifest.json index b96673c..61fb72d 100644 --- a/manifest.json +++ b/manifest.json @@ -192,7 +192,8 @@ "claude-cli.md": "Claude Code CLI \u2014 install, commands, flags, MCP config, local LLM usage", "codex-cli.md": "OpenAI Codex CLI \u2014 install, approval modes, AGENTS.md, local LLM usage", "cursor-cli.md": "Cursor IDE/CLI \u2014 agent mode, rules, MCP, local LLM, Gitea integration", - "local-llm.llm.md": "Local LLMs \u2014 Gemma-4-E4B (8080) + Gemma-4-26B (8081), OpenAI-compatible API" + "local-llm.llm.md": "Local LLMs \u2014 Gemma-4-E4B (8080) + Gemma-4-26B (8081), OpenAI-compatible API", + "discord.md": "Discord bot \u2014 read/send messages, channel IDs for all guilds, raw API patterns" } }, "agents": { diff --git a/tools/README.md b/tools/README.md index 0ec50e6..b88352b 100644 --- a/tools/README.md +++ b/tools/README.md @@ -25,6 +25,7 @@ Each file covers one surface — authentication, available resources, and common | [`claude-cli.md`](./claude-cli.md) | Claude Code CLI | Install · commands · flags · MCP · local LLM wiring | | [`codex-cli.md`](./codex-cli.md) | OpenAI Codex CLI | Install · approval modes · AGENTS.md · local LLM wiring | | [`cursor-cli.md`](./cursor-cli.md) | Cursor IDE/CLI | Agent mode · rules · MCP · local LLM · Gitea integration | +| [`discord.md`](./discord.md) | Discord (via Silma's bot) | Read/send messages · channel IDs · guild map · raw API | ## Adding a New Tool diff --git a/tools/discord.md b/tools/discord.md new file mode 100644 index 0000000..c9a377e --- /dev/null +++ b/tools/discord.md @@ -0,0 +1,152 @@ +# Discord Guide for AI Agents + +Silma has a live Discord bot connection. Any AI agent working in this environment can read and post to Discord channels through the bot scripts. No extra auth setup needed — the token is in `credentials/secrets.env`. + +--- + +## Quick Reference + +```bash +# All commands run from the workspace root: +cd /Users/Tabitha/.openclaw/workspace + +# Send a message to a channel +python3 skills/discord/scripts/discord_bot.py send "Your message" + +# Read recent messages from a channel +python3 skills/discord/scripts/discord_bot.py read --limit 10 + +# Send a DM to a user +python3 skills/discord/scripts/discord_bot.py dm "Your message" + +# List channels in a guild +python3 skills/discord/scripts/discord_bot.py channels +``` + +--- + +## Bot Token + +Loaded automatically from `credentials/secrets.env` → `$DISCORD_TOKEN`. + +If you need it directly in Python: +```python +import subprocess +result = subprocess.run( + ['bash', '-c', 'source credentials/secrets.env && echo $DISCORD_TOKEN'], + capture_output=True, text=True, + cwd='/Users/Tabitha/.openclaw/workspace' +) +token = result.stdout.strip() +``` + +--- + +## Guilds (Servers) + +| Server | Guild ID | Purpose | +|--------|----------|---------| +| JMathison Silo'd | `1509655659291873370` | Silma's primary server — status, logs, journal, alerts | +| AMS Enterprises | `1446580217383747727` | Pipeline channels — **pipeline data only, no casual chat** | +| Bone Lord Bob | `1492348171169431592` | BLB project collaboration | + +--- + +## JMathison Silo'd — Channel IDs + +| Channel | ID | Purpose | +|---------|----|---------| +| #general | `1509655661888274443` | General chat | +| #announcements | `1509660829174333544` | Announcements | +| #silma-status | `1509660832177590443` | Silma mode/energy status | +| #research | `1509660838087364730` | Research drops | +| #news-feed | `1509660845154635826` | Interesting finds | +| #memory-log | `1509660841950314639` | Memory/knowledge updates | +| #journal | `1509660915455365151` | Daily journal entries | +| #prayers | `1509660919096016996` | Morning/evening prayers | +| #mood-board | `1509660922019578019` | Current mood | +| #alerts | `1509660905552609331` | System errors, broken services | +| #hb_signals | `1509660908627034133` | Heartbeat completion logs | +| #bot-logs | `1509660902218137640` | Bot actions log | +| #dev-log | `1509660870454542346` | Dev work log | +| #bone-lord-bob | `1509660876179898369` | BLB project updates | +| #infra | `1509660879929479198` | Infrastructure notes | +| #banner-and-pyre | `1510347078654628080` | Banner & Pyre project | +| #banner-and-pyre-rss | `1510517278553149450` | Banner & Pyre Gitea issue notifications | + +--- + +## AMS Enterprises — Pipeline Channel IDs + +⚠️ **These channels are monitored by the sales-helper bot. Pipeline data only — no casual conversation.** + +| Channel | ID | +|---------|----| +| #opportunities | `1446581171847696514` | +| #prospected | `1446581198179799120` | +| #contacted | `1446581227992780972` | +| #meetings-scheduled | `1446581306166087730` | + +--- + +## Key People — Discord User IDs + +| Person | Username | User ID | +|--------|----------|---------| +| Jacob Mathison (Father) | — | `5541991143` (Telegram ID — use DM for direct messages) | +| Hunter Albert | smackface | `320333815853744128` | +| Aaron Pressey | goatlord2567 | — | +| Silma (bot) | — | `1341854647253602406` | + +--- + +## Raw API (when you need more control) + +```python +import json, urllib.request, subprocess + +def discord_api(method, path, data=None): + result = subprocess.run( + ['bash', '-c', 'source credentials/secrets.env && echo $DISCORD_TOKEN'], + capture_output=True, text=True, + cwd='/Users/Tabitha/.openclaw/workspace' + ) + token = result.stdout.strip() + req = urllib.request.Request( + f'https://discord.com/api/v10{path}', + data=json.dumps(data).encode() if data else None, + method=method, + headers={ + 'Authorization': f'Bot {token}', + 'Content-Type': 'application/json', + 'User-Agent': 'DiscordBot (https://discord.com, 10)' + } + ) + with urllib.request.urlopen(req) as r: + return json.loads(r.read()) if r.length else {} + +# Examples: +# Post a message +discord_api('POST', '/channels/1509660832177590443/messages', {'content': 'Hello!'}) + +# Update a channel topic +discord_api('PATCH', '/channels/1509660832177590443', {'topic': 'New topic'}) + +# Get recent messages +discord_api('GET', '/channels/1509660832177590443/messages?limit=10') +``` + +--- + +## Notes for AI Agents + +- **Don't spam.** One message per event. No "I'm doing X now" + "Done" double-posts. +- **No markdown tables** in Discord messages — use bullet lists instead. +- **Suppress link embeds** by wrapping URLs in `<>`: `` +- **AMS pipeline channels** are for structured pipeline data only — never post casual notes there. +- **The sales-helper bot** monitors AMS channels and records everything. Treat those channels as a database, not a chat. +- **Check before posting** to `#journal` and `#prayers` — only one post per day per channel. +- To get an up-to-date channel list for a guild, run: +```bash +python3 skills/discord/scripts/discord_bot.py channels 1509655659291873370 +```