diff --git a/pkg/channels/qq/qq.go b/pkg/channels/qq/qq.go index 05e2c4f3a..e37645855 100644 --- a/pkg/channels/qq/qq.go +++ b/pkg/channels/qq/qq.go @@ -37,7 +37,7 @@ const ( dedupInterval = 60 * time.Second dedupMaxSize = 10000 // hard cap on dedup map entries typingResend = 8 * time.Second - typingSeconds = 20 + typingSeconds = 10 ) var emojiRegexp = regexp.MustCompile(`<[^<]*?ext="([^"]+)"[^<]*?faceType=(\d+)[^<]*?>|<[^<]*?faceType=(\d+)[^<]*?ext="([^"]+)"[^<]*?>`) @@ -57,6 +57,8 @@ type QQChannel struct { // Passive reply: store last inbound message ID per chat. lastMsgID sync.Map // chatID → string + // 消息回复时API时的SEQ,用于回复时去重 + // 被动回复: 同一个chatID+replyMsgID+seq 去重。 主动回复:不限制。 replySeq atomic.Uint32 seqLock sync.Mutex @@ -248,9 +250,9 @@ func (c *QQChannel) getReplyExtInfo(ctx context.Context, chatID string) (replyID defer c.seqLock.Unlock() seq = c.replySeq.Add(1) if seq > math.MaxInt32 { - c.replySeq.Store(1) + c.replySeq.Store(0) + seq = c.replySeq.Add(1) } - return replyID, seq } diff --git a/pkg/config/config.go b/pkg/config/config.go index 190341224..c98e04b82 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -351,7 +351,6 @@ type QQConfig struct { AllowFrom FlexibleStringSlice `json:"allow_from" env:"PICOCLAW_CHANNELS_QQ_ALLOW_FROM"` GroupTrigger GroupTriggerConfig `json:"group_trigger,omitempty"` MaxMessageLength int `json:"max_message_length" env:"PICOCLAW_CHANNELS_QQ_MAX_MESSAGE_LENGTH"` - SendMarkdown bool `json:"send_markdown" env:"PICOCLAW_CHANNELS_QQ_SEND_MARKDOWN"` ReasoningChannelID string `json:"reasoning_channel_id" env:"PICOCLAW_CHANNELS_QQ_REASONING_CHANNEL_ID"` }