-
Notifications
You must be signed in to change notification settings - Fork 6
Huge amounts more Effect in the codebase #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 deployedIt may take a few minutes before the service becomes available.
Deployed commit: This preview will be updated on each push and deleted when the PR is closed. |
No description provided.