-
Notifications
You must be signed in to change notification settings - Fork 0
/
entities.go
65 lines (52 loc) · 1.42 KB
/
entities.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
package telegram
import "encoding/json"
const (
DefaultURL = "https://api.telegram.org"
MethodSendMessage = "sendMessage"
MethodSetWebhook = "setWebhook"
)
type Response struct {
OK bool `json:"ok"`
Description *string `json:"description"`
Result json.RawMessage `json:"result"`
}
type Update struct {
ID int64 `json:"id"`
Message *Message `json:"message"`
}
type Message struct {
ID int64 `json:"message_id"`
Chat Chat `json:"chat"`
Text string `json:"text"`
From *User `json:"from"`
Contact *Contact `json:"contact"`
}
type Contact struct {
Phone string `json:"phone_number"`
UserID *int64 `json:"user_id"`
}
type User struct {
ID int64 `json:"id"`
}
type Chat struct {
ID int64 `json:"id"`
}
type SendMessageArgs struct {
ChatID int64 `json:"chat_id"`
Text string `json:"text"`
ReplyMarkup interface{} `json:"reply_markup,omitempty"`
}
type ReplyKeyboardMarkup struct {
Keyboard [][]KeyboardButton `json:"keyboard"`
ResizeKeyboard bool `json:"resize_keyboard"`
OneTimeKeyboard bool `json:"one_time_keyboard"`
Selective bool `json:"selective"`
}
type KeyboardButton struct {
Text string `json:"text"`
RequestContact bool `json:"request_contact"`
RequestLocation bool `json:"request_location"`
}
type SetWebhookArgs struct {
URL string `json:"url"`
}