Conversation
- Create app/effects/discordSdk.ts with Effect-wrapped Discord.js helpers: fetchGuild, fetchChannel, fetchMember, fetchMessage, sendMessage, etc. - Add fetchSettingsEffect to guilds.server.ts for Effect-based settings fetch - Update escalate, report, and resolver code to use new SDK helpers - Consolidate error types in effects/errors.ts (rename discordError -> cause) - Fix missing Layer imports and service layer provision in handlers Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Phase 1: demo.ts, force-ban.ts, report.ts - Phase 2: setup.ts, setupReactjiChannel.ts, setupHoneypot.ts, setupTickets.ts - Phase 3: escalationControls.ts, escalate/handlers.ts (8 handlers) Replaced async/await with Effect.gen, trackPerformance with Effect.withSpan, log() with logEffect(), and try/catch with Effect.catchAll patterns. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
EFFECT.md rewritten as a "reading and writing Effect code" guide with real codebase examples and file references. EFFECT_REFERENCE.md trimmed to only patterns we use, with outdated syntax fixed. Unused patterns (Streams, Schedules, etc.) moved to new EFFECT_ADVANCED.md. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR represents a massive conversion effort to adopt Effect-TS patterns throughout the codebase, including comprehensive documentation updates, new SDK wrappers, and conversion of all command handlers to Effect-based implementations.
Changes:
- Created comprehensive Effect documentation suite (EFFECT.md, EFFECT_REFERENCE.md, EFFECT_ADVANCED.md) with practical patterns and examples
- Implemented Discord SDK Effect wrappers (
discordSdk.ts) for consistent error handling across Discord.js operations - Converted all command handlers (setup, report, force-ban, track, escalation system, tickets, etc.) from async/await to Effect-based implementations
- Standardized error types by renaming fields (
discordError/stripeError→cause) and consolidating error classes - Refactored database operations to use Effect patterns with new
fetchSettingsEffectand other Effect-returning functions
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
| notes/EFFECT*.md | Complete documentation overhaul - reference guide, onboarding, and advanced patterns |
| app/effects/discordSdk.ts | New file with Effect wrappers for all Discord API operations |
| app/effects/errors.ts | Consolidated error types, renamed fields for consistency |
| app/commands/escalate/handlers.ts | Converted 8 handlers to pure Effect with improved error handling |
| app/commands/*.ts | Converted all slash commands and context menus to Effect-based handlers |
| app/models/*.ts | Added Effect-returning database operations alongside legacy versions |
| app/commands/report/*.ts | Refactored logging and reporting system to use Effect patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Preview environment removedThe preview for this PR has been cleaned up. |
87e9c1d to
211ae79
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Effect.tryPromisecalls to use a "discord sdk" helper file