picoclaw/pkg/channels
Vernon Stinebaker 2fb2a733d4
feat(discord): add mention_only option for @-mention responses (#518)
* feat(discord): add mention_only option for @-mention responses

Add MentionOnly config option to Discord channel. When enabled, the bot
only responds when explicitly @-mentioned, useful for shared servers.

- Add MentionOnly bool field to DiscordConfig
- Store botUserID on startup for mention checking
- Check m.Mentions before processing messages when MentionOnly is true
- Update config example and README documentation

* fix(discord): resolve race condition and strip mention from content

- Get botUserID before opening session to avoid race condition
- Add stripBotMention to remove @mention from message content
- Handles both <@USER_ID> and <@!USER_ID> mention formats

* fix(discord): skip mention_only check for DMs

DMs should always be responded to regardless of mention_only setting.
Added check to skip the mention_only logic when GuildID is empty.

* Update README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Hua Audio <161028864+Huaaudio@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-20 12:18:37 +01:00
..
base.go merge: sync upstream/main into feat/multi-agent-routing 2026-02-14 10:38:04 -03:00
base_test.go style: fix gofmt formatting (CRLF -> LF) 2026-02-14 11:21:47 +09:00
dingtalk.go fix(channels): channels session key routing (#489) 2026-02-20 13:27:08 +08:00
discord.go feat(discord): add mention_only option for @-mention responses (#518) 2026-02-20 12:18:37 +01:00
feishu_32.go add build constraints for feishu to support 32-bit builds 2026-02-11 20:59:25 +01:00
feishu_64.go fix(channels): channels session key routing (#489) 2026-02-20 13:27:08 +08:00
line.go fix(channels): channels session key routing (#489) 2026-02-20 13:27:08 +08:00
maixcam.go fix(channels): channels session key routing (#489) 2026-02-20 13:27:08 +08:00
manager.go feat: implement structured Telegram command handling with a dedicated command service and telegohandler integration. (#164) 2026-02-16 14:20:16 +08:00
onebot.go fix(channels): channels session key routing (#489) 2026-02-20 13:27:08 +08:00
qq.go fix(channels): channels session key routing (#489) 2026-02-20 13:27:08 +08:00
slack.go merge: sync upstream/main into feat/multi-agent-routing 2026-02-16 10:34:55 -03:00
slack_test.go refactor(channels): consolidate media handling and improve resource cleanup 2026-02-12 12:46:28 +08:00
telegram.go Merge remote-tracking branch 'origin/main' into feat/refactor-provider-by-protocol 2026-02-20 00:11:46 +08:00
telegram_commands.go feat: implement structured Telegram command handling with a dedicated command service and telegohandler integration. (#164) 2026-02-16 14:20:16 +08:00
whatsapp.go fix(channels): channels session key routing (#489) 2026-02-20 13:27:08 +08:00