mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-26 15:47:13 +09:00
- DiscordRest and DiscordGateway are made in fromContext and passed to the constructor. Both read the token from config, and guildId is a getter over config, so the plugin has no nullable bot state. - DiscordGateway is an EventEmitter and the plugin listens with bound methods (onGatewayReady, onGatewayDispatch, onGatewayFatalClose, onLinkChanged). - Private members start with an underscore. - DiscordGateway has an explicit state (stopped, connecting, identifying, ready, waiting) and _setState throws on a transition not in the table. Errors while handling a gateway message are logged so a failed assert can't take down the controller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>