feat(config): allow placeholder text to be string or list

Allow PlaceholderConfig.Text to accept either a single string or an
array of strings, from which one is randomly selected at runtime.
This maintains backward compatibility with existing single-string configs
while enabling random placeholder selection.

Changes:
- Modify PlaceholderConfig.Text type from string to FlexibleStringSlice
- Add GetRandomText() helper method for random selection
- Update SendPlaceholder in all channels to use GetRandomText()
- Update config.example.json with array placeholder examples
- Update Matrix channel documentation
This commit is contained in:
hezixu
2026-03-25 17:41:50 +08:00
parent 5f50ae5e76
commit dc956f2feb
10 changed files with 44 additions and 28 deletions
+1 -4
View File
@@ -211,10 +211,7 @@ func (c *FeishuChannel) SendPlaceholder(ctx context.Context, chatID string) (str
return "", nil
}
text := c.config.Placeholder.Text
if text == "" {
text = "Thinking..."
}
text := c.config.Placeholder.GetRandomText()
cardContent, err := buildMarkdownCard(text)
if err != nil {