-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
97 lines (85 loc) · 3.2 KB
/
types.go
File metadata and controls
97 lines (85 loc) · 3.2 KB
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
package telegrambotgo
type ApiResponse struct {
Ok bool `json:"ok"`
}
type UpdatesResponse struct {
ApiResponse
Result []*Update `json:"result"`
}
type SendMessageResponse struct {
ApiResponse
Result *Message `json:"result"`
}
type Update struct {
UpdateId int `json:"update_id"`
Message *Message `json:"message"`
EditedMessage *Message `json:"edited_message"`
}
type Message struct {
MessageId int `json:"message_id"`
From *User `json:"from"`
Date int `json:"date"`
Chat *Chat `json:"chat"`
ForwardFrom *User `json:"forward_from"`
ForwardFromChat *Chat `json:"forward_from_chat"`
Text string `json:"text"`
Entities []*MessageEntity `json:"entities"`
NewChatMember *User `json:"new_chat_member"`
LeftChatMember *User `json:"left_chat_member"`
Caption string `json:"caption"`
Photo []*PhotoSize `json:"photo"`
}
type User struct {
UserId int `json:"id"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
UserName string `json:"username"`
}
type Chat struct {
ChatId int64 `json:"id"`
Type string `json:"type"`
Title string `json:"title"`
UserName string `json:"username"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
}
type MessageEntity struct {
Type string `json:"type"`
Offset int `json:"offset"`
Length int `json:"length"`
Url string `json:"url"`
User *User `json:"user"`
}
type PhotoSize struct {
FileId string `json:"file_id"`
Width int `json:"width"`
Height int `json:"height"`
FileSize int `json:"file_size"`
}
type SendMessageRequest struct {
ChatId int64 `json:"chat_id"`
Text string `json:"text"`
ParseMode string `json:"parse_mode,omitempty"`
DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"`
DisableNotification bool `json:"disable_notification,omitempty"`
ReplyToMessageId int `json:"reply_to_message_id,omitempty"`
}
type SendPhotoRequest struct {
ChatId int64 `json:"chat_id"`
Photo string `json:"photo"` // This might be a byte representation of the photo (local path to the image) or a string containing the file id
Caption string `json:"caption,omitempty"`
DisableNotification bool `json:"disable_notification,omitempty"`
ReplyToMessageId int `json:"reply_to_message_id,omitempty"`
IsLocalFile bool `json:"-"`
}
type SendAudioRequest struct {
ChatId int64 `json:"chat_id"`
Audio string `json:"audio"` // This might be a byte representation of the photo (local path to the image) or a string containing the file id
Caption string `json:"caption,omitempty"`
Duration int `json:"duration,omitempty"`
Performer string `json:"performer,omitempty"`
Title string `json:"title,omitempty"`
DisableNotification bool `json:"disable_notification,omitempty"`
ReplyToMessageId int `json:"reply_to_message_id,omitempty"`
IsLocalFile bool `json:"-"`
}