refactor: resolve architecture disconnects and codebase weaknesses

- Consolidate eventTypes.ts as single source of truth for Redis channels:
  - Remove duplicate DiscordGatewayEvent interface from eventBroadcaster.ts
  - Replace all hardcoded channel strings with EventChannels constants
  - eventTypes.ts is no longer an orphan file

- Remove dangerous moderation action feature (selfbot safety):
  - Remove /messages/:id/moderate endpoint from backend
  - Remove moderation:action handler from commandHandler.ts
  - Remove publishFireAndForgetCommand (wrong envelope format)
  - Verified no remaining references to moderation:action in code

- Remove unused getCommandPublisher import from redis-bridge.ts

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MythEclipse
2026-06-09 13:22:09 +07:00
co-authored by Claude Opus 4.8
parent 3614d32701
commit 7d6612bb2d
4 changed files with 15 additions and 99 deletions
+2 -2
View File
@@ -152,12 +152,12 @@ export function useDashboardSocket(handlers: WsHandlers) {
onUserState: (u) => handlersRef.current.onUserState?.(u),
onUiState: (s) => handlersRef.current.onUiState?.(s),
onMediaState: (s) => handlersRef.current.onMediaState?.(s),
onVoiceRecordingUploaded: (d) =>
handlersRef.current.onVoiceRecordingUploaded?.(d),
onVoiceRecordingStarted: (d) =>
handlersRef.current.onVoiceRecordingStarted?.(d),
onVoiceRecordingStopped: (d) =>
handlersRef.current.onVoiceRecordingStopped?.(d),
onVoiceRecordingUploaded: (d) =>
handlersRef.current.onVoiceRecordingUploaded?.(d),
onVoicePcmData: (d) => handlersRef.current.onVoicePcmData?.(d),
onVoiceActiveUser: (d) => handlersRef.current.onVoiceActiveUser?.(d),
};