mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
09cdb8c87f
- Extract parseTelegramTarget helper to consolidate duplicated @username vs numeric chat ID parsing from 6+ locations (builder functions, sendTelegramTextReturnMessage, sendTelegramAttachmentImpl) - Extract Config.baseURL() to eliminate duplicate base URL resolution between apiEndpoint() and fileEndpoint() - Refactor stream.go Push method: extract resetStreamState(), deliverFinalText(), and per-event-type sub-methods (pushDelta, pushFinal, pushToolCallStart, pushAttachment, pushPhaseEnd, pushError), reducing the 200-line switch-case to a clean dispatcher - Use pushFinal's existing getBot() instead of duplicating parseConfig + getOrCreateBot - Replace sort.SliceStable with slices.SortStableFunc + cmp.Compare - Replace strings.Index + manual slicing with strings.Cut in decodeDataURLBytes, ResolveAttachment, and parseTelegramUserInput