feat: 更新 SendMsg 和 SendForward 函数以支持字符串类型的用户ID和群组ID,增强数据处理的灵活性

This commit is contained in:
lixiangwuxian
2025-04-10 00:37:43 +08:00
parent 09b4edf387
commit 169f176192
2 changed files with 25 additions and 8 deletions

View File

@@ -14,14 +14,14 @@ type SendPkg struct {
// 上游包的参数结构体
type UpstreamParams struct {
UserID int64 `json:"user_id"`
GroupID int64 `json:"group_id"`
Message any `json:"message"`
AutoEscape bool `json:"auto_escape"`
UserID string `json:"user_id,omitempty"`
GroupID string `json:"group_id,omitempty"`
Message any `json:"message"`
AutoEscape bool `json:"auto_escape,omitempty"`
}
func GenSendPkg(userID int64, groupID int64, message any, autoEscape bool, forward bool) SendPkg {
if groupID == 0 {
func GenSendPkg(userID string, groupID string, message any, autoEscape bool, forward bool) SendPkg {
if groupID == "" {
if forward {
return SendPkg{
Action: constants.FORWARD_MSG_SEND,