This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpack.go
168 lines (147 loc) · 4.94 KB
/
pack.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
package botoy
type basePack struct {
CurrentPacket struct {
Data interface{} `json:"Data"`
WebConnID string `json:"WebConnId"`
} `json:"CurrentPacket"`
CurrentQQ int64 `json:"CurrentQQ"`
}
// ConnectedPack socketio连接上
type ConnectedPack struct{}
const onConnectedPack = "botoy.ConnectedPack"
// DisConnectedPack socketio 断开连接
type DisConnectedPack struct{}
const onDisConnectedPack = "botoy.DisConnectedPack"
// GroupMsgPack 群消息
type GroupMsgPack struct {
CurrentQQ int64 `json:"CurrentQQ,omitempty"`
Content string `json:"Content"`
FromGroupID int64 `json:"FromGroupId"`
FromGroupName string `json:"FromGroupName"`
FromNickName string `json:"FromNickName"`
FromUserID int64 `json:"FromUserId"`
MsgRandom int `json:"MsgRandom"`
MsgSeq int `json:"MsgSeq"`
MsgTime int `json:"MsgTime"`
MsgType string `json:"MsgType"`
RedBaginfo interface{} `json:"RedBaginfo"`
}
const onGroupMsgsPack = "botoy.GroupMsgPack"
// FriendMsgPack 好友消息
type FriendMsgPack struct {
CurrentQQ int64 `json:"CurrentQQ,omitempty"`
Content string `json:"Content"`
FromUin int64 `json:"FromUin"`
MsgSeq int `json:"MsgSeq"`
MsgType string `json:"MsgType"`
ToUin int64 `json:"ToUin"`
TempUin int64 `json:"TempUin"`
RedBaginfo interface{} `json:"RedBaginfo"`
}
const onFriendMsgsPack = "botoy.FriendMsgPack"
// GroupJoinPack 加群事件
type GroupJoinPack struct {
CurrentQQ int64 `json:"CurrentQQ,omitempty"`
EventData struct {
InviteUin int64 `json:"InviteUin"`
UserID int64 `json:"UserID"`
UserName string `json:"UserName"`
} `json:"EventData"`
EventMsg struct {
FromUin int64 `json:"FromUin"`
ToUin int64 `json:"ToUin"`
MsgType string `json:"MsgType"`
MsgSeq int `json:"MsgSeq"`
Content string `json:"Content"`
RedBaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
}
const onGroupJoinPack = "botoy.GroupJoinPack"
// GroupExitPack 退群事件
type GroupExitPack struct {
CurrentQQ int64 `json:"CurrentQQ,omitempty"`
EventData struct {
UserID int64 `json:"UserID"`
} `json:"EventData"`
EventMsg struct {
FromUin int64 `json:"FromUin"`
ToUin int64 `json:"ToUin"`
MsgType string `json:"MsgType"`
MsgSeq int `json:"MsgSeq"`
Content string `json:"Content"`
RedBaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
}
const onGroupExitPack = "botoy.GroupExitPack"
// GroupExitSuccessPack 退群事件
type GroupExitSuccessPack struct {
CurrentQQ int64 `json:"CurrentQQ,omitempty"`
EventData struct {
GroupID int64 `json:"GroupID"`
} `json:"EventData"`
EventMsg struct {
FromUin int64 `json:"FromUin"`
ToUin int64 `json:"ToUin"`
MsgType string `json:"MsgType"`
MsgSeq int `json:"MsgSeq"`
Content string `json:"Content"`
RedBaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
}
const onGroupExitSuccessPack = "botoy.GroupExitSuccessPack"
// GroupRevokePack 群撤回消息
type GroupRevokePack struct {
CurrentQQ int64 `json:"CurrentQQ,omitempty"`
EventData struct {
AdminUserID int `json:"AdminUserID"`
GroupID int64 `json:"GroupID"`
MsgRandom int64 `json:"MsgRandom"`
MsgSeq int `json:"MsgSeq"`
UserID int64 `json:"UserID"`
} `json:"EventData"`
EventMsg struct {
FromUin int64 `json:"FromUin"`
ToUin int64 `json:"ToUin"`
MsgType string `json:"MsgType"`
MsgSeq int `json:"MsgSeq"`
Content string `json:"Content"`
RedBaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
}
const onGroupRevokePack = "botoy.GroupRevokePack"
// GroupShutPack 群禁言
type GroupShutPack struct {
CurrentQQ int64 `json:"CurrentQQ,omitempty"`
EventData struct {
GroupID int64 `json:"GroupID"`
ShutTime int `json:"ShutTime"`
UserID int64 `json:"UserID"`
} `json:"EventData"`
EventMsg struct {
FromUin int64 `json:"FromUin"`
ToUin int64 `json:"ToUin"`
MsgType string `json:"MsgType"`
MsgSeq int `json:"MsgSeq"`
Content string `json:"Content"`
RedBaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
}
const onGroupShutPack = "botoy.GroupShutPack"
// FriendRevokePack 好友撤回事件
type FriendRevokePack struct {
CurrentQQ int64 `json:"CurrentQQ,omitempty"`
Eventdata struct {
Msgseq int `json:"MsgSeq"`
Userid int `json:"UserID"`
} `json:"EventData"`
Eventmsg struct {
Fromuin int `json:"FromUin"`
Touin int `json:"ToUin"`
Msgtype string `json:"MsgType"`
Msgseq int `json:"MsgSeq"`
Content string `json:"Content"`
Redbaginfo interface{} `json:"RedBaginfo"`
} `json:"EventMsg"`
Eventname string `json:"EventName"`
}
const onFriendRevokePack = "botoy.FriendRevokePack"