# Discord Bot Setup for Fleet Machines

Each OpenClaw instance gets its own Discord bot for independent identity.

## Creating a New Discord Bot

1. Go to https://discord.com/developers/applications
2. Click "New Application" -> name it (e.g., OC-Mac, OC-Beast)
3. Go to Bot tab -> "Reset Token" -> copy the token
4. Under Privileged Gateway Intents, enable:
   - Message Content Intent
   - Server Members Intent
5. Save token in 1Password (Infrastructure vault)

## Inviting to Server

Replace CLIENT_ID with the Application ID from General Information tab:

```
https://discord.com/oauth2/authorize?client_id=CLIENT_ID&scope=bot+applications.commands&permissions=277025770560
```

This grants: read/send messages, manage messages, create threads, slash commands, reactions, attachments.

Pick "Arizona Computer Guru" server and authorize.

## Configuring OpenClaw

After onboarding, set the Discord token:

```bash
openclaw config set channels.discord.enabled true
openclaw config set channels.discord.token "BOT_TOKEN_HERE"
openclaw config set channels.discord.groupPolicy allowlist
openclaw config set channels.discord.streaming off
openclaw config set 'channels.discord.guilds' '{"*":{}}'
openclaw gateway restart
```

Or retrieve from 1Password and set in one shot:

```bash
TOKEN=$(op item get "Discord Bot Token: OC-Mac" --vault "Infrastructure" --fields label=credential --reveal)
openclaw config set channels.discord.token "$TOKEN"
```

## Bot Identities

| Bot | Machine | Discord App | Status |
|-----|---------|-------------|--------|
| OC-5070 | Lenovo Legion (CachyOS) | OC-5070 (ID: 1470449493668528384) | Active |
| OC-Mac | MacBook Air M4 | TBD | Pending |
| OC-Beast | Home Desktop Win11 | OC-Beast (ID: 1486348116373274674) | Active |

## Server Channels (Suggested)

Consider creating dedicated channels:
- #general — human + all bots
- #bot-coordination — bots talking to each other
- #alerts — proactive notifications from any bot
