diff --git a/action/action.go b/action/action.go index 2b0cfe3..163f8bd 100644 --- a/action/action.go +++ b/action/action.go @@ -31,7 +31,7 @@ func (am *actionManager) SendAction(action string) error { func (am *actionManager) SendMsg(reply model.Reply) error { if reply.ReferOriginMsg { - reply.ReplyMsg = fmt.Sprintf("%s%s", GenReply(reply.FromMsg.OriginMsgId, "", 0, 0, 0), reply.ReplyMsg) + reply.ReplyMsg = fmt.Sprintf("%s%s", GenReplyCQ(reply.FromMsg.OriginMsgId, "", 0, 0, 0), reply.ReplyMsg) } sendPkg := model.GenSendPkg(reply.FromMsg.UserId, reply.FromMsg.GroupInfo.GroupId, reply.ReplyMsg, false) sendPkgJson, err := json.Marshal(sendPkg) diff --git a/action/cq_msg_gen.go b/action/cq_msg_gen.go index 780009a..2e72fe4 100644 --- a/action/cq_msg_gen.go +++ b/action/cq_msg_gen.go @@ -2,7 +2,7 @@ package action import "fmt" -func GenReply(msgId int32, text string, qq int64, time int64, seq int64) string { +func GenReplyCQ(msgId int32, text string, qq int64, time int64, seq int64) string { if msgId == 0 { return "" } diff --git a/model/action.go b/model/action.go index 3e7544c..00477e3 100644 --- a/model/action.go +++ b/model/action.go @@ -13,3 +13,32 @@ func GenDrawbackPkg(msgId int32) Action { }, } } + +// 戳一戳GenPokePkg +func GenPokePkg(groupId int64, userId int64) Action { + if groupId != 0 { + return Action{ + Action: "send_poke", + Params: map[string]interface{}{ + "group_id": groupId, + "user_id": userId, + }, + } + } + return Action{ + Action: "send_poke", + Params: map[string]interface{}{ + "user_id": userId, + }, + } +} + +// 获取群成员列表 GenGetGroupMemberListPkg +func GenGetGroupMemberListPkg(groupId int64) Action { + return Action{ + Action: "get_group_member_list", + Params: map[string]interface{}{ + "group_id": groupId, + }, + } +}