Conversation
…pabilities) Phase 1 of discord.js selfbot port. Creates foundational modules: - SuperProperties: browser fingerprint for X-Super-Properties header and gateway IDENTIFY - BrowserHeaders: Chrome-like Sec-CH-UA, Sec-Fetch-*, Discord locale/timezone headers - Capabilities: gateway bitfield (22525) matching discord.py-self defaults - Build number fetching via cordapi.dolfi.es API with hardcoded fallback
API returns {client: {build_number}} not {properties: {client_build_number}}.
Verified: fetches build number 507841 successfully.
- authPrefix defaults to '' (raw token, no "Bot " prefix) - User-Agent defaults to Chrome UA from SuperProperties - All requests include browser headers (Sec-CH-UA, X-Super-Properties, etc.) - SuperProperties added to RESTOptions for shared fingerprinting - RequestHeaders interface allows arbitrary browser headers
Phase 3 — Gateway: - Rewrite IDENTIFY payload to user-style (capabilities, super_properties, client_state, presence) — no intents, no shard array - Change fetchGatewayInformation return type from /gateway/bot to /gateway - Add UserIdentifyData and UserPresenceData interfaces for type safety - Default to single shard, remove session_start_limit dependency Phase 4 — Client Integration: - Remove intents requirement from Client constructor (capabilities used instead) - Switch gateway endpoint from Routes.gatewayBot() to Routes.gateway() - Simplify login() — no more "Bot " prefix stripping - Make Client options parameter optional - Remove ShardClientUtil, set this.shard = null - Remove dead fetchRecommendedShardCount and unused imports
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (17)
📝 WalkthroughWalkthroughThis pull request removes sharding support from the discord.js client, introduces browser-fingerprinting headers via SuperProperties in the REST layer, and refactors the WebSocket layer to support user accounts through a new capabilities system. The client constructor now defaults to an empty options object, gateway fetches return only a URL, and identify payloads are restructured without intents or shard information. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant REST
participant SuperProperties
participant Gateway
participant WebSocketManager
Client->>REST: Create request with token
REST->>SuperProperties: generate browser headers (if superProperties available)
SuperProperties-->>REST: browserHeaders (Accept, User-Agent, X-Super-Properties, etc.)
REST->>REST: merge browserHeaders into request.headers
REST->>REST: set Authorization header (authPrefix + token or just token)
REST->>Gateway: send request with browser fingerprinting
Gateway-->>REST: response
REST-->>Client: return data
Client->>WebSocketManager: connect()
WebSocketManager->>Gateway: fetchGatewayInformation()
Gateway-->>WebSocketManager: { url: string }
WebSocketManager->>WebSocketManager: getShardIds (default to 1 shard)
WebSocketManager->>WebSocketManager: spawn shards
WebSocketManager->>WebSocketManager: identify with UserIdentifyData (capabilities, presence, no intents)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
No description provided.