$npx -y skills add mphinance/alpha-skills --skill discord-admin-botSend messages to and read messages from the TraderDaddy-Pro Discord (#admin-discussion by default) using the alpha-skills bot. Triggers on "post to discord", "send to admin-discussion", "discord post", "read discord", "what's in #admin-discussion", "last N discord messages", "pin
| 1 | # Discord Admin Bot |
| 2 | |
| 3 | Send and read messages in the TraderDaddy-Pro Discord using the bot token at `discord.txt`. Default channel is `#admin-discussion`; can target other channels by name once they've been discovered. |
| 4 | |
| 5 | ## When to invoke |
| 6 | - "post to discord: <message>" |
| 7 | - "send to #admin-discussion: <message>" |
| 8 | - "what's been said in discord lately" |
| 9 | - "read last 20 messages from admin-discussion" |
| 10 | - Any request mentioning the TraderDaddy-Pro Discord, #admin-discussion, or "the bot" |
| 11 | |
| 12 | ## Flow |
| 13 | |
| 14 | ### Send a message |
| 15 | ``` |
| 16 | python scripts/send.py "Your message here" |
| 17 | ``` |
| 18 | Optional flags: |
| 19 | - `--channel <name>` — target a different channel by name (must be in `discord_config.json`) |
| 20 | - `--channel-id <id>` — target by raw ID |
| 21 | |
| 22 | ### Read recent messages |
| 23 | ``` |
| 24 | python scripts/read.py --limit 20 |
| 25 | ``` |
| 26 | Optional flags: |
| 27 | - `--channel <name>` / `--channel-id <id>` — same as above |
| 28 | - `--format full` — include timestamps, authors, attachments; default is compact |
| 29 | |
| 30 | ### Discover channels (one-time, or when channel layout changes) |
| 31 | ``` |
| 32 | python scripts/discover.py |
| 33 | ``` |
| 34 | Lists every guild the bot is in and every text channel inside, and updates `discord_config.json` with the resolved IDs for `#admin-discussion`. |
| 35 | |
| 36 | ## Hard rules |
| 37 | |
| 38 | - **Never print the token.** Loaded silently from `discord.txt` or `$DISCORD_BOT_TOKEN`. |
| 39 | - **Never commit `discord.txt` or `discord_config.json`.** The repo root `.gitignore` blocks both. |
| 40 | - **Confirm before destructive ops.** No deleting messages without explicit user instruction. Sending and reading are fine without confirmation; deletion requires Michael saying "delete that". |
| 41 | - **Respect Discord rate limits.** The client retries once on 429 with the `Retry-After` value; if a second 429 hits, fail loud rather than spam. |
| 42 | - **No automated cross-posting.** This skill is for direct user-driven sends, not webhook-style notifications. For algo entry/exit alerts, use the existing `core/discord_notify.py` webhook setup in the `mur` repo. |
| 43 | |
| 44 | ## Token loading order |
| 45 | 1. `$DISCORD_BOT_TOKEN` env var (highest priority) |
| 46 | 2. `discord.txt` in the skill folder (the install step copies it here from the alpha-skills repo) |
| 47 | 3. `discord.txt` in the current working directory |
| 48 | 4. `discord.txt` walking up from CWD until a parent contains it |
| 49 | |
| 50 | ## Setup (already done if installed via the build) |
| 51 | 1. Discord developer portal → Bot → enable **MESSAGE CONTENT INTENT** (required to read message bodies, not just metadata). |
| 52 | 2. Bot must be invited to the TraderDaddy-Pro guild with `View Channels` + `Send Messages` + `Read Message History` permissions on `#admin-discussion`. |
| 53 | 3. `discord_config.json` populated by `discover.py`. |
| 54 | |
| 55 | If sending or reading fails with 401 → token is wrong. With 403 → permissions missing. With 404 → channel ID stale, re-run `discover.py`. |
| 56 | |
| 57 | See [api_reference.md](references/api_reference.md) for the underlying endpoints and rate-limit handling. |