Skip to content

Add Discord Early Adopter role for EAP customers#384

Merged
simonhamp merged 2 commits into
mainfrom
discord-early-adopter-role
May 18, 2026
Merged

Add Discord Early Adopter role for EAP customers#384
simonhamp merged 2 commits into
mainfrom
discord-early-adopter-role

Conversation

@simonhamp
Copy link
Copy Markdown
Member

Summary

Mirrors the existing Max Discord role flow for Early Access Program (EAP) customers. Users who purchased licenses before June 1, 2025 (isEapCustomer()) can now receive the Early Adopter Discord role (role ID 1326505265079521353) automatically when connecting their Discord account, or via a dedicated request button on the access banner.

Changes

  • config/services.php: New early_adopter_role_id config key backed by DISCORD_EARLY_ADOPTER_ROLE_ID env var.
  • app/Support/DiscordApi.php: Refactored role API calls into shared assignRole / removeRole / hasRole helpers and added assignEarlyAdopterRole(), removeEarlyAdopterRole(), and hasEarlyAdopterRole().
  • Migration: Adds discord_early_adopter_role_granted_at timestamp to users table.
  • User model: Casts the new timestamp.
  • DiscordAccessBanner Livewire component: Tracks hasEarlyAdopterRole status and adds a requestEarlyAdopterRole() action gated on isEapCustomer() and guild membership.
  • Blade banner: Displays Max and Early Adopter role badges side by side (Active / Eligible) and renders a request button for each eligible role independently.
  • DiscordIntegrationController: On OAuth callback, assigns both Max and Early Adopter roles when applicable. On disconnect, removes both roles.

Configuration

Add to .env:

DISCORD_EARLY_ADOPTER_ROLE_ID=1326505265079521353

Test plan

  • Unit/feature tests pass (16 new tests, 1074 tests total green)
  • Connect Discord as an EAP-only customer → Early Adopter role is granted, badge shows Active
  • Connect Discord as Max + EAP customer → both roles are granted
  • Connect Discord as non-EAP customer → no Early Adopter role granted
  • EAP customer who joins the server after connecting clicks "Request Early Adopter Role" → role granted
  • Disconnect Discord while holding the Early Adopter role → role removed

🤖 Generated with Claude Code

simonhamp and others added 2 commits May 18, 2026 16:07
Mirrors the existing Max role flow: EAP customers (users with licenses
created before June 1, 2025) can now receive the Early Adopter Discord
role automatically when connecting their Discord account, or via the
request button on the access banner.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@simonhamp simonhamp marked this pull request as ready for review May 18, 2026 20:31
@simonhamp simonhamp merged commit 9c9da7f into main May 18, 2026
2 checks passed
@simonhamp simonhamp deleted the discord-early-adopter-role branch May 18, 2026 20:31
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.

1 participant