From 362b61b8aafcc8b09987c74eaac797567080e88a Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Tue, 21 Sep 2021 00:57:53 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=87=AA=E5=8A=A8=E5=8A=A0=E5=A5=BD?= =?UTF-8?q?=E5=8F=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qbot/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qbot/main.go b/qbot/main.go index 54088c9..5d30844 100644 --- a/qbot/main.go +++ b/qbot/main.go @@ -102,8 +102,14 @@ func Main() { } } + + OnFriendMessage := func(_ *client.QQClient, m *client.NewFriendRequest) { + m.Accept() + } + coolq.PrivateMessageEventCallback = models.ListenQQPrivateMessage coolq.GroupMessageEventCallback = models.ListenQQGroupMessage + bot.Client.OnNewFriendRequest(OnFriendMessage) // c := flag.String("c", config.DefaultConfigFile, "configuration filename default is config.hjson") // d := flag.Bool("d", false, "running as a daemon")