-
Notifications
You must be signed in to change notification settings - Fork 1
/
channel.go
239 lines (202 loc) · 6.97 KB
/
channel.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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
package tgstat_go
type ChannelResponse struct {
Id int `json:"id"`
Link string `json:"link"`
Username string `json:"username"`
Title string `json:"title"`
About string `json:"about"`
Category string `json:"category"`
Country string `json:"country"`
Language string `json:"Language"`
Image100 string `json:"image100"`
Image640 string `json:"image640"`
ParticipantsCount int `json:"participants_count"`
TGStatRestriction interface{} `json:"tgstat_restrictions"`
}
type TGStatRestrictions struct {
RedLabel bool `json:"red_label"`
BlackLabel bool `json:"black_label"`
}
type ChannelResponseResult struct {
Status string `json:"status"`
Response ChannelResponse `json:"response"`
}
type ChannelSearchResult struct {
Status string `json:"status"`
Response ChannelSearch `json:"response"`
}
type ChannelSearchItem struct {
Id int `json:"id"`
Link string `json:"link"`
Username string `json:"username"`
Title string `json:"title"`
About string `json:"about"`
Image100 string `json:"image100"`
Image640 string `json:"image640"`
ParticipantsCount int `json:"participants_count"`
}
type ChannelSearch struct {
Count int `json:"count"`
Items []ChannelSearchItem `json:"items"`
}
type ChannelStatResult struct {
Status string `json:"status"`
Response ChannelStatResponse `json:"response"`
}
type ChannelStatResponse struct {
Id int `json:"id"`
Title string `json:"title"`
Username string `json:"username"`
ParticipantsCount int `json:"participants_count"`
AvgPostReach int `json:"avg_post_reach"`
ErrPercent float64 `json:"err_percent"`
DailyReach int `json:"daily_reach"`
CiIndex float64 `json:"ci_index"`
}
type ChannelPostsWithChannelResponseItem struct {
ID int64 `json:"id"`
Date int `json:"date"`
Views int `json:"views"`
Link string `json:"link"`
ChannelID int `json:"channel_id"`
ForwardedFrom interface{} `json:"forwarded_from"`
IsDeleted int `json:"is_deleted"`
Text string `json:"text"`
Media ChannelMedia `json:"media"`
}
type ChannelMedia struct {
MediaType string `json:"media_type"`
MimeType string `json:"mime_type"`
Size int `json:"size"`
}
type Channel struct {
ID int `json:"id"`
Link string `json:"link"`
Username string `json:"username"`
Title string `json:"title"`
About string `json:"about"`
Image100 string `json:"image100"`
Image640 string `json:"image640"`
ParticipantsCount int `json:"participants_count"`
}
type ChannelPostsWithChannelResponse struct {
Count int `json:"count"`
TotalCount int `json:"total_count"`
Channel Channel `json:"channel"`
Items []ChannelPostsWithChannelResponseItem `json:"items"`
}
type ChannelPostsWithChannelResult struct {
Status string `json:"status"`
Response ChannelPostsWithChannelResponse `json:"response"`
}
type ChannelPostsResponseItem struct {
ID int64 `json:"id"`
Date int `json:"date"`
Views int `json:"views"`
Link string `json:"link"`
ChannelID int `json:"channel_id"`
ForwardedFrom string `json:"forwarded_from"`
IsDeleted int `json:"is_deleted"`
Text string `json:"text"`
Media ChannelMedia `json:"media"`
}
type ChannelPostsResponse struct {
Count int `json:"count"`
TotalCount int `json:"total_count"`
Channel Channel `json:"channel"`
Items []ChannelPostsResponseItem `json:"items"`
}
type ChannelPostsResult struct {
Status string `json:"status"`
Response ChannelPostsResponse `json:"response"`
}
type MentionItem struct {
MentionID int `json:"mentionId"`
MentionType string `json:"mentionType"`
PostID int64 `json:"postId"`
PostLink string `json:"postLink"`
PostDate int `json:"postDate"`
ChannelID int `json:"channelId"`
}
type ChannelMentionsResponse struct {
Items []MentionItem `json:"items"`
}
type ChannelMentionsResponseExtended struct {
Items []MentionItem `json:"items"`
Channels []Channel `json:"channels"`
}
type ChannelMentionsResult struct {
Status string `json:"status"`
Response ChannelMentionsResponse `json:"response"`
}
type ChannelMentionsExtended struct {
Status string `json:"status"`
Response ChannelMentionsResponseExtended `json:"response"`
}
type ForwardItem struct {
ForwardID int `json:"forwardId"`
PostID int64 `json:"postId"`
PostLink string `json:"postLink"`
PostDate int `json:"postDate"`
ChannelID int `json:"channelId"`
}
type ChannelForwardsResponseExtended struct {
Items []ForwardItem `json:"items"`
Channels []Channel `json:"channels"`
}
type ChannelForwardsExtended struct {
Status string `json:"status"`
Response ChannelForwardsResponseExtended `json:"response"`
}
type ChannelForwardsResponse struct {
Items []ForwardItem `json:"items"`
}
type ChannelForwards struct {
Status string `json:"status"`
Response ChannelForwardsResponse `json:"response"`
}
type ChannelSubscribersResponse struct {
Period string `json:"period"`
ParticipantsCount uint `json:"participants_count,string"`
}
type ChannelSubscribers struct {
Status string `json:"status"`
Response []ChannelSubscribersResponse `json:"response"`
}
type ViewItem struct {
Period string `json:"period"`
ViewsCount int `json:"views_count"`
}
type ChannelViewsResponse struct {
Period string `json:"period"`
ViewsCount float64 `json:"views_count"`
}
type ChannelViews struct {
Status string `json:"status"`
Response []ChannelViewsResponse `json:"response"`
}
type ChannelAvgReachResponse struct {
Period string `json:"period"`
AvgPostsReach float64 `json:"avg_posts_reach"`
}
type ChannelAvgReach struct {
Status string `json:"status"`
Response []ChannelAvgReachResponse `json:"response"`
}
type ChannelErrResponse struct {
Period string `json:"period"`
Err float64 `json:"err"`
}
type ChannelErr struct {
Status string `json:"status"`
Response []ChannelErrResponse `json:"response"`
}
type ChannelAddPending struct {
Status string `json:"status"`
}
type ChannelAddSuccess struct {
Status string `json:"status"`
Response struct {
ChannelId int `json:"channelId"`
} `json:"response,omitempty"`
}