Files
Memoh/internal/channel/common/logging.go
BBQ f376a2abe3 fix(channel): add wechatoa webhook delivery and proxy config (#356)
Unify webhook handling across channel adapters and add the WeChat Official Account channel so inbound routing and replies work without platform-specific handlers. Add adapter-scoped proxy support and stable config field ordering so restricted network environments can deliver WeChat and Telegram messages reliably.
2026-04-10 21:26:11 +08:00

19 lines
428 B
Go

// Package common provides shared utilities for channel adapters.
package common
import (
"strings"
"github.com/memohai/memoh/internal/textutil"
)
// SummarizeText returns a truncated preview of the text, limited to 120 characters.
func SummarizeText(text string) string {
value := strings.TrimSpace(text)
if value == "" {
return ""
}
const limit = 120
return textutil.TruncateRunesWithSuffix(value, limit, "...")
}