-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
38 lines (31 loc) · 934 Bytes
/
types.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
package vkbotgo
import "encoding/json"
// APIParameters describes API method parameters with validate method
type APIParameters interface {
Validate() error
}
//Event represents an event coming from the VK server.
type Event struct {
Type string `json:"type"`
Object json.RawMessage `json:"object"`
GroupID int64 `json:"group_id"`
}
//EventsChannel is the channel for getting events.
type EventsChannel chan *Event
// VkError is a error in response of VK API
type VkError struct {
ErrorCode int `json:"error_code"`
ErrorMsg string `json:"error_msg"`
// TODO: params
}
// VkResponse is a raw response from the VK API.
type VkResponse struct {
Error *VkError `json:"error"`
Response json.RawMessage `json:"response"`
}
//Confirmation contains group and string for Vk conformation request.
type Confirmation struct {
Pattern string
GroupID int64
ResponseBytes []byte
}