mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user