-
Notifications
You must be signed in to change notification settings - Fork 5
/
opcode.go
30 lines (26 loc) · 854 Bytes
/
opcode.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
package nano
import "encoding/json"
// OpCode https://bot.q.qq.com/wiki/develop/api/gateway/opcode.html
type OpCode int
const (
OpCodeDispatch OpCode = iota // Receive
OpCodeHeartbeat // Send/Receive
OpCodeIdentify // Send
OpCodeEmpty1
OpCodeEmpty2
OpCodeEmpty3
OpCodeResume // Send
OpCodeReconnect // Receive
OpCodeEmpty4
OpCodeInvalidSession // Receive
OpCodeHello // Receive
OpCodeHeartbeatACK // Receive/Reply
OpCodeHTTPCallbackACK // Reply
)
// OpCodeIdentifyMessage https://bot.q.qq.com/wiki/develop/api/gateway/reference.html#_2-%E9%89%B4%E6%9D%83%E8%BF%9E%E6%8E%A5
type OpCodeIdentifyMessage struct {
Token string `json:"token"`
Intents uint32 `json:"intents"`
Shard [2]byte `json:"shard"`
Properties json.RawMessage `json:"properties"`
}