refactor: convert to modular system with Hytale update trackers
- Core infrastructure: module interface, Telegram wrapper, OAuth token manager, state store - Migrate Discord forwarder to modules/discord-forwarder/ - Add Hytale update trackers: launcher, patches, downloader, server - Support multiple Telegram chats with per-chat topic IDs - Unified config with legacy migration and env var fallbacks - Auto-refresh OAuth tokens (5min buffer) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
369a37903f
commit
a7d4df6986
29 changed files with 1368 additions and 121 deletions
23
src/core/module.ts
Normal file
23
src/core/module.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import type { StateStore } from './state-store.js'
|
||||
import type { TelegramClient } from './telegram-client.js'
|
||||
import type { TokenManager } from './token-manager.js'
|
||||
|
||||
export interface Module {
|
||||
readonly name: string
|
||||
start: () => Promise<void>
|
||||
stop: () => Promise<void>
|
||||
isRunning: () => boolean
|
||||
}
|
||||
|
||||
export interface ModuleFactory {
|
||||
(config: unknown, deps: ModuleDependencies): Module
|
||||
}
|
||||
|
||||
export interface ModuleDependencies {
|
||||
telegram: TelegramClient
|
||||
tokenManager?: TokenManager
|
||||
stateStore: StateStore
|
||||
logger: Logger
|
||||
}
|
||||
|
||||
export type Logger = (module: string, message: string, ...args: unknown[]) => void
|
||||
Loading…
Add table
Add a link
Reference in a new issue