fix(wecom): strip @mention from group chat messages to fix slash commands
WeCom AI Bot does not strip @mention from text.content in group chats, causing all slash commands (/stop, /clear, /help) to fail — the content arrives as "@BotName /stop" instead of "/stop". - Add stripAtMentionBasic (stateless) and stripAtMention (with bot name caching) to handle multi-word bot display names - Support bot_name in channel credentials for immediate precision - Apply stripping in both WebSocket and webhook adapters, text and mixed - Add mention_test.go with 21 test cases
This commit is contained in:
@@ -1009,6 +1009,7 @@ func registerIMAdapterFactories(imService *imPkg.Service) {
|
||||
client := wecom.NewLongConnClient(
|
||||
getString(creds, "bot_id"),
|
||||
getString(creds, "bot_secret"),
|
||||
getString(creds, "bot_name"),
|
||||
msgHandler,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user