mirror of
https://github.com/fumiama/NanoBot.git
synced 2026-06-08 12:10:23 +08:00
finish bot 框架
This commit is contained in:
@@ -12,10 +12,15 @@ import (
|
||||
type WebsocketPayload struct {
|
||||
Op OpCode `json:"op"`
|
||||
D json.RawMessage `json:"d,omitempty"`
|
||||
S int `json:"s,omitempty"`
|
||||
S uint32 `json:"s,omitempty"`
|
||||
T string `json:"t,omitempty"`
|
||||
}
|
||||
|
||||
// Reset 恢复到 0 值
|
||||
func (wp *WebsocketPayload) Reset() {
|
||||
*wp = WebsocketPayload{}
|
||||
}
|
||||
|
||||
// GetHeartbeatInterval OpCodeHello 获得心跳周期 单位毫秒
|
||||
func (wp *WebsocketPayload) GetHeartbeatInterval() (uint32, error) {
|
||||
if wp.Op != OpCodeHello {
|
||||
|
||||
Reference in New Issue
Block a user