(client: TelegramClient)
| 48 | for (const dialog of dialogs || []) { |
| 49 | if (dialog.isGroup || (dialog.isChannel && (dialog.entity as any)?.megagroup)) { |
| 50 | dialogsById.set(Number(dialog.id), dialog); |
| 51 | } |
| 52 | } |
| 53 | }; |
| 54 | |
| 55 | await collectDialogs({}); |
| 56 | await collectDialogs({ folderId: 1 }); |
| 57 | |
| 58 | return Array.from(dialogsById.keys()); |
| 59 | } |
| 60 | |
| 61 | // ==================== 缓存管理器 ==================== |
| 62 | type CacheData = { |
| 63 | cache: Record<string, any>; |
| 64 | daily_history?: Record<string, string[]>; // groupId -> textHashes[] |
| 65 | last_day_check?: number; |
| 66 | trigger_config?: { timeWindow: number; minUsers: number }; // 触发条件配置 |
| 67 | }; |
| 68 | |
| 69 | class CacheManager { |
no test coverage detected