Merge pull request '🎨 修改邀请入群消息默认响应消息为配置消息' (#103) from hotfix into main
Some checks failed
BuildImage / build-image (push) Has been cancelled
Some checks failed
BuildImage / build-image (push) Has been cancelled
Reviewed-on: #103
This commit is contained in:
commit
8968def643
@ -140,3 +140,7 @@ resource:
|
|||||||
wordcloud:
|
wordcloud:
|
||||||
type: image
|
type: image
|
||||||
path: D:\Share\wordcloud\%s
|
path: D:\Share\wordcloud\%s
|
||||||
|
# 邀请入群消息回复
|
||||||
|
invitationJoinGroup:
|
||||||
|
type: text
|
||||||
|
path: "您的邀请消息已收到啦,正在通知我的主人来同意请求。在我加群之后将会进行初始化操作,直到收到我主动发送的消息就是初始化完成咯,在那之前请耐心等待喔~"
|
||||||
|
@ -14,8 +14,21 @@ import (
|
|||||||
// @description: 通知邀请入群消息到配置用户
|
// @description: 通知邀请入群消息到配置用户
|
||||||
// @param m
|
// @param m
|
||||||
func NotifyInvitationJoinGroup(m *plugin.MessageContext) {
|
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 {
|
if flag, dec := m.IsInvitationJoinGroup(); flag {
|
||||||
@ -23,7 +36,7 @@ func NotifyInvitationJoinGroup(m *plugin.MessageContext) {
|
|||||||
if user != "" {
|
if user != "" {
|
||||||
// 发送一条新消息
|
// 发送一条新消息
|
||||||
dec = fmt.Sprintf("#邀请入群提醒\n\n%s", dec)
|
dec = fmt.Sprintf("#邀请入群提醒\n\n%s", dec)
|
||||||
utils.SendMessage(user, "", dec, 0)
|
_ = utils.SendMessage(user, "", dec, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user