fix: only handle @bot message from slack once. This removes @bot calls from handleMessageEvent handler
This commit is contained in:
parent
9a3f3611c3
commit
e520621432
1 changed files with 5 additions and 1 deletions
|
|
@ -198,6 +198,11 @@ func (c *SlackChannel) handleMessageEvent(ev *slackevents.MessageEvent) {
|
|||
return
|
||||
}
|
||||
|
||||
// Check if this is an app mention (bot was mentioned) - if so, let handleAppMention handle it
|
||||
if strings.Contains(ev.Text, fmt.Sprintf("<@%s>", c.botUserID)) {
|
||||
return
|
||||
}
|
||||
|
||||
// 检查白名单,避免为被拒绝的用户下载附件
|
||||
if !c.IsAllowed(ev.User) {
|
||||
logger.DebugCF("slack", "Message rejected by allowlist", map[string]interface{}{
|
||||
|
|
@ -227,7 +232,6 @@ func (c *SlackChannel) handleMessageEvent(ev *slackevents.MessageEvent) {
|
|||
})
|
||||
|
||||
content := ev.Text
|
||||
content = c.stripBotMention(content)
|
||||
|
||||
var mediaPaths []string
|
||||
localFiles := []string{} // 跟踪需要清理的本地文件
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue