From 592c306aa082a4860109368e8c7b9c9d3899e5c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Thu, 28 Apr 2022 23:29:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E9=80=9Fword=20count?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/word_count/word_count.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/word_count/word_count.go b/plugin/word_count/word_count.go index 5dbc266b..4bf06662 100644 --- a/plugin/word_count/word_count.go +++ b/plugin/word_count/word_count.go @@ -96,11 +96,11 @@ func init() { return } messageMap := make(map[string]int, 256) - h := ctx.GetLatestGroupMessageHistory(gid) - messageSeq := h.Get("messages.0.message_seq").Int() - msghists := make(chan *gjson.Result, 64) - msghists <- &h + msghists := make(chan *gjson.Result, 256) go func() { + h := ctx.GetLatestGroupMessageHistory(gid) + messageSeq := h.Get("messages.0.message_seq").Int() + msghists <- &h for i := 1; i < int(p/20) && messageSeq != 0; i++ { h := ctx.GetGroupMessageHistory(gid, messageSeq) msghists <- &h