mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
f376a2abe3
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.
19 lines
428 B
Go
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, "...")
|
|
}
|