Skip to content

feat: Discord quickstart UX — plugin check, general channel selection, options output#48

Merged
suzuke merged 4 commits into
suzuke:mainfrom
changhansung:fix/discord-quickstart-ux
Apr 21, 2026
Merged

feat: Discord quickstart UX — plugin check, general channel selection, options output#48
suzuke merged 4 commits into
suzuke:mainfrom
changhansung:fix/discord-quickstart-ux

Conversation

@changhansung

Copy link
Copy Markdown
Contributor

Problem

Discord users face incomplete setup UX in agend quickstart:

  1. No plugin check — Users select Discord but discover @suzuke/agend-plugin-discord is missing only at runtime
  2. No general channel selectionoptions.general_channel_id is never asked, so general dispatcher / approval prompts don't work after setup
  3. No category name option — Users must manually edit fleet.yaml to set options.category_name

Fix

All changes in src/quickstart.ts (+73/-6):

Plugin Check

  • Before Discord token input, checks npm list -g @suzuke/agend-plugin-discord --depth=0
  • If not found: warns with install command, asks "Continue anyway? [Y/n]"
  • Non-blocking — user can proceed without plugin

General Channel Selection (new Step 5/5)

  • Calls Discord API GET /guilds/{guild_id}/channels to list text channels
  • Filters type === 0 (GuildText), sorts by name, limits to 20
  • User selects from numbered list; fallback to manual ID input if API fails
  • NaN input guard: isNaN(parsed) ? 0 : clamp(parsed)

Category Name

  • Asks category name with default "AgEnD Agents"
  • Only written to fleet.yaml when non-default

fleet.yaml Output

channel:
  type: discord
  ...
  options:
    general_channel_id: "345678901"
    category_name: "Custom Name"  # only if non-default

Step Numbering

  • Discord: 5 steps (Backend → Channel → Bot → Guild & User → General Channel)
  • Telegram: unchanged at 4 steps

Tests

tests/quickstart.test.ts — 14 new test cases:

  • listDiscordChannels: API success, API error, network failure
  • Channel filtering: type 0 only, sort + limit 20
  • Input validation: NaN default, empty default, out-of-range clamp
  • Options output: general_channel_id, category_name non-default, default omission, empty ID
  • Full fleet.yaml structure with options block
  • Plugin check command pattern

All 505 tests pass (60 test files).

…s output

- Add listDiscordChannels() to fetch guild text channels via API
- Plugin check: warn if @suzuke/agend-plugin-discord not installed
- New Step 5: general channel selection from API list (fallback to manual)
- Category name prompt (default: 'AgEnD Agents')
- fleet.yaml output includes options.general_channel_id + category_name
- Dynamic totalSteps (5 for Discord, 4 for Telegram)
- Next steps adapts based on plugin installation status
@suzuke suzuke merged commit 08bee22 into suzuke:main Apr 21, 2026
2 checks passed
@suzuke suzuke mentioned this pull request Apr 21, 2026
3 tasks
HsiaoHsuan pushed a commit to HsiaoHsuan/AgEnD that referenced this pull request May 28, 2026
Minor bump for PR suzuke#48 (Discord quickstart UX improvements).

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants