Skip to content

feat(feishu): add random reaction emoji config#1171

Merged
alexhoshina merged 6 commits intosipeed:mainfrom
mutezebra:feat/feishu-random-emoji-v2
Mar 8, 2026
Merged

feat(feishu): add random reaction emoji config#1171
alexhoshina merged 6 commits intosipeed:mainfrom
mutezebra:feat/feishu-random-emoji-v2

Conversation

@mutezebra
Copy link
Contributor

@mutezebra mutezebra commented Mar 6, 2026

📝 Description

This PR introduces a new configuration option random_reaction_emoji for the Feishu (Lark) channel.
It allows users to customize the emoji reaction used by the bot when processing messages.

  • Supports configuring a list of emojis (e.g., ["Typing", "OncSecond"]).
  • The bot will randomly select one emoji from the list for each reaction.
  • Defaults to ["Pin"] if the configuration is missing, preserving existing behavior.
  • Updates documentation and example configuration files.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

📚 Technical Context (Skip for Docs)

  • Reference URL: Feishu Emoji List
  • Reasoning:
    The default "Pin" emoji reaction was hardcoded, which some users found undesirable. Changing it required modifying the source code and recompiling.
    This change makes the reaction emoji configurable via config.json or environment variables (PICOCLAW_CHANNELS_FEISHU_RANDOM_REACTION_EMOJI).
    Additionally, supporting a random selection from a list adds variety and makes the bot feel more dynamic/human-like compared to a static emoji.

🧪 Test Environment

  • Hardware: Local Development Environment
  • OS: macOS / Linux
  • Model/Provider: N/A
  • Channels: Feishu (Lark)

📸 Evidence (Optional)

Click to view Logs/Screenshots image image

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

- Add random_reaction_emoji config for Feishu channel
- Update .env.example with new env vars
- Update documentation (README.zh.md)
Add an info log for `RandomReactionEmoji` configuration.
@CLAassistant
Copy link

CLAassistant commented Mar 6, 2026

CLA assistant check
All committers have signed the CLA.

@alexhoshina
Copy link
Collaborator

alexhoshina commented Mar 8, 2026

This PR looks good, please resolve the conflicts and prepare for merging
and make lint plz

// Default to "Pin" if no config
emojiList = []string{"Pin"}
}
logger.Info(fmt.Sprintf("[MABEN] c.config.RandomReactionEmoji, %v", c.config.RandomReactionEmoji))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this log a debug log? Perhaps it needs to be deleted

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, i will fix that

logger.Info(fmt.Sprintf("[MABEN] c.config.RandomReactionEmoji, %v", c.config.RandomReactionEmoji))

// Randomly choose one from the list
chosenEmoji := emojiList[rand.Intn(len(emojiList))]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This might be pseudo-random, but it's not a big deal and won't affect the merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Hi, I've run make lint and updated the implementation to the 'true random' approach suggested by the AI."

@mutezebra
Copy link
Contributor Author

@alexhoshina Hello, sorry to bother you, but I have little experience contributing to open-source projects. I'd like to ask, when will a PR be merged?

@alexhoshina
Copy link
Collaborator

alexhoshina commented Mar 8, 2026

hi, @mutezebra I'm evaluating whether we need to introduce the relatively heavy crypto/rand library to achieve true randomness. As I mentioned in my previous review, pseudo-randomness is not a blocker for merging. Introducing crypto/rand would make things a bit heavier.

@alexhoshina alexhoshina merged commit 7ea7bb0 into sipeed:main Mar 8, 2026
4 checks passed
dj-oyu pushed a commit to dj-oyu/picoclaw that referenced this pull request Mar 8, 2026
…i-v2

feat(feishu): add random reaction emoji config
@Orgmar
Copy link
Contributor

Orgmar commented Mar 9, 2026

@mutezebra Random reaction emoji config for Feishu is a fun feature, makes the bot feel less robotic when interacting in group chats. Nice addition.

We have a PicoClaw Dev Group on Discord for contributors to connect and share ideas. If you want to join, send an email to support@sipeed.com with the subject [Join PicoClaw Dev Group] mutezebra and we'll send you the invite link!

@mutezebra
Copy link
Contributor Author

@mutezebra Random reaction emoji config for Feishu is a fun feature, makes the bot feel less robotic when interacting in group chats. Nice addition.飞书的随机反应表情配置是个很有意思的功能,能让机器人在群聊互动时少些机械感。这个新增功能很不错。

We have a PicoClaw Dev Group on Discord for contributors to connect and share ideas. If you want to join, send an email to support@sipeed.com with the subject [Join PicoClaw Dev Group] mutezebra and we'll send you the invite link!我们在 Discord 上设有 PicoClaw 开发者群组,供贡献者们交流互动、分享创意。若您想要加入,请发送邮件至 support@sipeed.com ,邮件主题为 [Join PicoClaw Dev Group] mutezebra ,我们会将邀请链接发送给您!

Thank you for your comment. I am very interested in it and have already sent the email.

fishtrees pushed a commit to fishtrees/picoclaw that referenced this pull request Mar 12, 2026
…i-v2

feat(feishu): add random reaction emoji config
dj-oyu pushed a commit to dj-oyu/picoclaw that referenced this pull request Mar 14, 2026
…i-v2

feat(feishu): add random reaction emoji config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants