Skip to content

Commit

Permalink
mod:补全json schema
Browse files Browse the repository at this point in the history
  • Loading branch information
dezhiShen authored and dezhiShen committed Oct 15, 2023
1 parent 7aab452 commit 1957b64
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions pkg/event/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,25 @@ import (
"github.com/dezhishen/satori-sdk-go/pkg/resource/user"
)

type SignInfo struct {
Op uint8 `json:"op"`
Body interface{} `json:"body,omitempty"`
}

type Event struct {
Id int64 //事件 ID
Type string //事件类型
Platform string //接收者的平台名称
SelfId string //接收者的平台账号
Timestamp int64 //事件的时间戳
Channel *channel.Channel //事件所属的频道
Guild *guild.Guild //事件所属的群组
Login *login.Login //事件的登录信息
Member *guildmember.GuildMember //事件的目标成员
Message *message.Message //事件的消息
Operator *user.User //事件的操作者
Role *guildrole.GuildRole //事件的目标角色
User *user.User //事件的目标用户
Id int64 `json:"id"` //事件 ID
Type string `json:"type"` //事件类型
Platform string `json:"platform"` //接收者的平台名称
SelfId string `json:"self_id"` //接收者的平台账号
Timestamp int64 `json:"timestamp"` //事件的时间戳
Channel *channel.Channel `json:"channel,omitempty"` //事件所属的频道
Guild *guild.Guild `json:"guild,omitempty"` //事件所属的群组
Login *login.Login `json:"login,omitempty"` //事件的登录信息
Member *guildmember.GuildMember `json:"member,omitempty"` //事件的目标成员
Message *message.Message `json:"message,omitempty"` //事件的消息
Operator *user.User `json:"operator,omitempty"` //事件的操作者
Role *guildrole.GuildRole `json:"role,omitempty"` //事件的目标角色
User *user.User `json:"user,omitempty"` //事件的目标用户
}

type EventHandlerCallback func(e Event) error
Expand Down

0 comments on commit 1957b64

Please sign in to comment.