From 99daff1938a4b44b53ca445dd679808c0b8df794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Thu, 29 Aug 2024 08:46:33 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BF=AE=E6=94=B9=E9=82=80=E8=AF=B7?= =?UTF-8?q?=E5=85=A5=E7=BE=A4=E6=B6=88=E6=81=AF=E9=BB=98=E8=AE=A4=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E6=B6=88=E6=81=AF=E4=B8=BA=E9=85=8D=E7=BD=AE=E6=B6=88?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.yaml | 4 ++++ plugin/plugins/notify2configuser.go | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/config.yaml b/config.yaml index ba0b5b1f..7030205f 100644 --- a/config.yaml +++ b/config.yaml @@ -140,3 +140,7 @@ resource: wordcloud: type: image path: D:\Share\wordcloud\%s + # 邀请入群消息回复 + invitationJoinGroup: + type: text + path: "您的邀请消息已收到啦,正在通知我的主人来同意请求。在我加群之后将会进行初始化操作,直到收到我主动发送的消息就是初始化完成咯,在那之前请耐心等待喔~" diff --git a/plugin/plugins/notify2configuser.go b/plugin/plugins/notify2configuser.go index 10bbfd12..0be89563 100644 --- a/plugin/plugins/notify2configuser.go +++ b/plugin/plugins/notify2configuser.go @@ -14,8 +14,21 @@ import ( // @description: 通知邀请入群消息到配置用户 // @param m func NotifyInvitationJoinGroup(m *plugin.MessageContext) { - // 先回复一条固定句子 - _ = utils.SendMessage(m.FromUser, m.GroupUser, "您的邀请消息已收到啦,正在通知我的主人来同意请求。在我加群之后将会进行初始化操作,直到收到我主动发送的消息就是初始化完成咯,在那之前请耐心等待喔~", 0) + // 先回复一条固定消息 + if conf, e := config.Conf.Resource["invitationJoinGroup"]; e { + // 发送一条新消息 + switch conf.Type { + case "text": + // 文字类型 + _ = utils.SendMessage(m.FromUser, "", conf.Path, 0) + case "image": + // 图片类型 + utils.SendImage(m.FromUser, conf.Path, 0) + case "emotion": + // 表情类型 + utils.SendEmotion(m.FromUser, conf.Path, 0) + } + } // 如果是邀请进群,推送到配置的用户 if flag, dec := m.IsInvitationJoinGroup(); flag { @@ -23,7 +36,7 @@ func NotifyInvitationJoinGroup(m *plugin.MessageContext) { if user != "" { // 发送一条新消息 dec = fmt.Sprintf("#邀请入群提醒\n\n%s", dec) - utils.SendMessage(user, "", dec, 0) + _ = utils.SendMessage(user, "", dec, 0) } } }