home / skills / lycfyi / community-agent-plugin / discord-init

This skill initializes Discord configuration by connecting your token, selecting a server, and saving settings to agents.yaml for first-time setup.

npx playbooks add skill lycfyi/community-agent-plugin --skill discord-init

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.5 KB
---
name: discord-init
description: "Initialize Discord configuration. Use when user wants to set up, configure, or connect their Discord account for the first time."
---

# Discord Init

Automatically configure the Discord server from your account.

## When to Use

- User says "set up Discord" or "configure Discord"
- User says "connect my Discord account"
- User says "initialize Discord"
- First time setup before syncing
- When `config/agents.yaml` doesn't exist or needs updating

## How to Execute

### Auto-detect and save server:

```bash
python ${CLAUDE_PLUGIN_ROOT}/tools/discord_init.py
```

### Select a specific server:

```bash
python ${CLAUDE_PLUGIN_ROOT}/tools/discord_init.py --server SERVER_ID
```

## What It Does

All paths are relative to cwd (current working directory):

1. Connects to Discord using your token from `./.env`
2. Lists all servers you have access to
3. If one server: auto-selects it
4. If multiple: selects the first one (or use `--server` to pick)
5. Saves configuration to `./config/agents.yaml`

## Output

Updates `./config/agents.yaml` with Discord settings:
- `discord.default_server_id`: Your Discord server ID
- `discord.default_server_name`: Server display name
- `data_dir`: Where messages are stored (shared setting)
- `discord.retention_days`: Default sync history

## Prerequisites

- `./.env` file with `DISCORD_USER_TOKEN` set (in cwd)
- Get your token: https://discordhunt.com/articles/how-to-get-discord-user-token

## Next Steps

After init, use discord-sync to download messages.

Overview

This skill initializes and saves Discord configuration so your agent can access and sync server messages. It connects with your Discord user token, detects available servers, and writes the chosen server settings into a local agents configuration file. Use it as the first setup step before running message sync or analysis tools.

How this skill works

The skill reads your DISCORD_USER_TOKEN from a local .env file and uses it to list servers you can access. It auto-selects a single server or picks the first available server (unless you pass a specific server ID). Finally, it writes the server ID, server name, data directory, and retention settings into ./config/agents.yaml for downstream tools to use.

When to use it

  • Setting up Discord access for the first time
  • Connecting or re-connecting a Discord account to the agent
  • Preparing a server before running message sync or analysis
  • When ./config/agents.yaml is missing or needs updating
  • Switching the default server for sync operations

Best practices

  • Store DISCORD_USER_TOKEN in a secure .env file in your working directory
  • Run the init tool from the project root so relative paths like ./config resolve correctly
  • Specify --server SERVER_ID to force a particular server when you have access to multiple servers
  • Verify ./config/agents.yaml after init to confirm data_dir and retention settings
  • Back up existing config before re-running init if you have custom changes

Example use cases

  • First-time setup: initialize Discord settings before running discord-sync
  • Recovering access: reconfigure if tokens or servers have changed
  • CI or automation: script initialization in deployment workflows with --server to select a known server
  • Multiple servers: quickly switch the default server ID used by sync and analysis tools
  • Preparing data collection: set data_dir and retention to control where and how much message history is stored

FAQ

What do I need before running init?

Place a .env file in the current working directory with DISCORD_USER_TOKEN set to your user token.

How do I select a specific server?

Run the init tool with --server SERVER_ID to force the chosen server instead of auto-selection.