-
Notifications
You must be signed in to change notification settings - Fork 100
/
supergroupMembersFilter.go
executable file
·303 lines (247 loc) · 12 KB
/
supergroupMembersFilter.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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
// AUTOGENERATED - DO NOT EDIT
package tdlib
import (
"encoding/json"
"fmt"
)
// SupergroupMembersFilter Specifies the kind of chat members to return in getSupergroupMembers
type SupergroupMembersFilter interface {
GetSupergroupMembersFilterEnum() SupergroupMembersFilterEnum
}
// SupergroupMembersFilterEnum Alias for abstract SupergroupMembersFilter 'Sub-Classes', used as constant-enum here
type SupergroupMembersFilterEnum string
// SupergroupMembersFilter enums
const (
SupergroupMembersFilterRecentType SupergroupMembersFilterEnum = "supergroupMembersFilterRecent"
SupergroupMembersFilterContactsType SupergroupMembersFilterEnum = "supergroupMembersFilterContacts"
SupergroupMembersFilterAdministratorsType SupergroupMembersFilterEnum = "supergroupMembersFilterAdministrators"
SupergroupMembersFilterSearchType SupergroupMembersFilterEnum = "supergroupMembersFilterSearch"
SupergroupMembersFilterRestrictedType SupergroupMembersFilterEnum = "supergroupMembersFilterRestricted"
SupergroupMembersFilterBannedType SupergroupMembersFilterEnum = "supergroupMembersFilterBanned"
SupergroupMembersFilterMentionType SupergroupMembersFilterEnum = "supergroupMembersFilterMention"
SupergroupMembersFilterBotsType SupergroupMembersFilterEnum = "supergroupMembersFilterBots"
)
func unmarshalSupergroupMembersFilter(rawMsg *json.RawMessage) (SupergroupMembersFilter, error) {
if rawMsg == nil {
return nil, nil
}
var objMap map[string]interface{}
err := json.Unmarshal(*rawMsg, &objMap)
if err != nil {
return nil, err
}
switch SupergroupMembersFilterEnum(objMap["@type"].(string)) {
case SupergroupMembersFilterRecentType:
var supergroupMembersFilterRecent SupergroupMembersFilterRecent
err := json.Unmarshal(*rawMsg, &supergroupMembersFilterRecent)
return &supergroupMembersFilterRecent, err
case SupergroupMembersFilterContactsType:
var supergroupMembersFilterContacts SupergroupMembersFilterContacts
err := json.Unmarshal(*rawMsg, &supergroupMembersFilterContacts)
return &supergroupMembersFilterContacts, err
case SupergroupMembersFilterAdministratorsType:
var supergroupMembersFilterAdministrators SupergroupMembersFilterAdministrators
err := json.Unmarshal(*rawMsg, &supergroupMembersFilterAdministrators)
return &supergroupMembersFilterAdministrators, err
case SupergroupMembersFilterSearchType:
var supergroupMembersFilterSearch SupergroupMembersFilterSearch
err := json.Unmarshal(*rawMsg, &supergroupMembersFilterSearch)
return &supergroupMembersFilterSearch, err
case SupergroupMembersFilterRestrictedType:
var supergroupMembersFilterRestricted SupergroupMembersFilterRestricted
err := json.Unmarshal(*rawMsg, &supergroupMembersFilterRestricted)
return &supergroupMembersFilterRestricted, err
case SupergroupMembersFilterBannedType:
var supergroupMembersFilterBanned SupergroupMembersFilterBanned
err := json.Unmarshal(*rawMsg, &supergroupMembersFilterBanned)
return &supergroupMembersFilterBanned, err
case SupergroupMembersFilterMentionType:
var supergroupMembersFilterMention SupergroupMembersFilterMention
err := json.Unmarshal(*rawMsg, &supergroupMembersFilterMention)
return &supergroupMembersFilterMention, err
case SupergroupMembersFilterBotsType:
var supergroupMembersFilterBots SupergroupMembersFilterBots
err := json.Unmarshal(*rawMsg, &supergroupMembersFilterBots)
return &supergroupMembersFilterBots, err
default:
return nil, fmt.Errorf("Error UnMarshaling, unknown type:" + objMap["@type"].(string))
}
}
// SupergroupMembersFilterRecent Returns recently active users in reverse chronological order
type SupergroupMembersFilterRecent struct {
tdCommon
}
// MessageType return the string telegram-type of SupergroupMembersFilterRecent
func (supergroupMembersFilterRecent *SupergroupMembersFilterRecent) MessageType() string {
return "supergroupMembersFilterRecent"
}
// NewSupergroupMembersFilterRecent creates a new SupergroupMembersFilterRecent
//
func NewSupergroupMembersFilterRecent() *SupergroupMembersFilterRecent {
supergroupMembersFilterRecentTemp := SupergroupMembersFilterRecent{
tdCommon: tdCommon{Type: "supergroupMembersFilterRecent"},
}
return &supergroupMembersFilterRecentTemp
}
// GetSupergroupMembersFilterEnum return the enum type of this object
func (supergroupMembersFilterRecent *SupergroupMembersFilterRecent) GetSupergroupMembersFilterEnum() SupergroupMembersFilterEnum {
return SupergroupMembersFilterRecentType
}
// SupergroupMembersFilterContacts Returns contacts of the user, which are members of the supergroup or channel
type SupergroupMembersFilterContacts struct {
tdCommon
Query string `json:"query"` // Query to search for
}
// MessageType return the string telegram-type of SupergroupMembersFilterContacts
func (supergroupMembersFilterContacts *SupergroupMembersFilterContacts) MessageType() string {
return "supergroupMembersFilterContacts"
}
// NewSupergroupMembersFilterContacts creates a new SupergroupMembersFilterContacts
//
// @param query Query to search for
func NewSupergroupMembersFilterContacts(query string) *SupergroupMembersFilterContacts {
supergroupMembersFilterContactsTemp := SupergroupMembersFilterContacts{
tdCommon: tdCommon{Type: "supergroupMembersFilterContacts"},
Query: query,
}
return &supergroupMembersFilterContactsTemp
}
// GetSupergroupMembersFilterEnum return the enum type of this object
func (supergroupMembersFilterContacts *SupergroupMembersFilterContacts) GetSupergroupMembersFilterEnum() SupergroupMembersFilterEnum {
return SupergroupMembersFilterContactsType
}
// SupergroupMembersFilterAdministrators Returns the owner and administrators
type SupergroupMembersFilterAdministrators struct {
tdCommon
}
// MessageType return the string telegram-type of SupergroupMembersFilterAdministrators
func (supergroupMembersFilterAdministrators *SupergroupMembersFilterAdministrators) MessageType() string {
return "supergroupMembersFilterAdministrators"
}
// NewSupergroupMembersFilterAdministrators creates a new SupergroupMembersFilterAdministrators
//
func NewSupergroupMembersFilterAdministrators() *SupergroupMembersFilterAdministrators {
supergroupMembersFilterAdministratorsTemp := SupergroupMembersFilterAdministrators{
tdCommon: tdCommon{Type: "supergroupMembersFilterAdministrators"},
}
return &supergroupMembersFilterAdministratorsTemp
}
// GetSupergroupMembersFilterEnum return the enum type of this object
func (supergroupMembersFilterAdministrators *SupergroupMembersFilterAdministrators) GetSupergroupMembersFilterEnum() SupergroupMembersFilterEnum {
return SupergroupMembersFilterAdministratorsType
}
// SupergroupMembersFilterSearch Used to search for supergroup or channel members via a (string) query
type SupergroupMembersFilterSearch struct {
tdCommon
Query string `json:"query"` // Query to search for
}
// MessageType return the string telegram-type of SupergroupMembersFilterSearch
func (supergroupMembersFilterSearch *SupergroupMembersFilterSearch) MessageType() string {
return "supergroupMembersFilterSearch"
}
// NewSupergroupMembersFilterSearch creates a new SupergroupMembersFilterSearch
//
// @param query Query to search for
func NewSupergroupMembersFilterSearch(query string) *SupergroupMembersFilterSearch {
supergroupMembersFilterSearchTemp := SupergroupMembersFilterSearch{
tdCommon: tdCommon{Type: "supergroupMembersFilterSearch"},
Query: query,
}
return &supergroupMembersFilterSearchTemp
}
// GetSupergroupMembersFilterEnum return the enum type of this object
func (supergroupMembersFilterSearch *SupergroupMembersFilterSearch) GetSupergroupMembersFilterEnum() SupergroupMembersFilterEnum {
return SupergroupMembersFilterSearchType
}
// SupergroupMembersFilterRestricted Returns restricted supergroup members; can be used only by administrators
type SupergroupMembersFilterRestricted struct {
tdCommon
Query string `json:"query"` // Query to search for
}
// MessageType return the string telegram-type of SupergroupMembersFilterRestricted
func (supergroupMembersFilterRestricted *SupergroupMembersFilterRestricted) MessageType() string {
return "supergroupMembersFilterRestricted"
}
// NewSupergroupMembersFilterRestricted creates a new SupergroupMembersFilterRestricted
//
// @param query Query to search for
func NewSupergroupMembersFilterRestricted(query string) *SupergroupMembersFilterRestricted {
supergroupMembersFilterRestrictedTemp := SupergroupMembersFilterRestricted{
tdCommon: tdCommon{Type: "supergroupMembersFilterRestricted"},
Query: query,
}
return &supergroupMembersFilterRestrictedTemp
}
// GetSupergroupMembersFilterEnum return the enum type of this object
func (supergroupMembersFilterRestricted *SupergroupMembersFilterRestricted) GetSupergroupMembersFilterEnum() SupergroupMembersFilterEnum {
return SupergroupMembersFilterRestrictedType
}
// SupergroupMembersFilterBanned Returns users banned from the supergroup or channel; can be used only by administrators
type SupergroupMembersFilterBanned struct {
tdCommon
Query string `json:"query"` // Query to search for
}
// MessageType return the string telegram-type of SupergroupMembersFilterBanned
func (supergroupMembersFilterBanned *SupergroupMembersFilterBanned) MessageType() string {
return "supergroupMembersFilterBanned"
}
// NewSupergroupMembersFilterBanned creates a new SupergroupMembersFilterBanned
//
// @param query Query to search for
func NewSupergroupMembersFilterBanned(query string) *SupergroupMembersFilterBanned {
supergroupMembersFilterBannedTemp := SupergroupMembersFilterBanned{
tdCommon: tdCommon{Type: "supergroupMembersFilterBanned"},
Query: query,
}
return &supergroupMembersFilterBannedTemp
}
// GetSupergroupMembersFilterEnum return the enum type of this object
func (supergroupMembersFilterBanned *SupergroupMembersFilterBanned) GetSupergroupMembersFilterEnum() SupergroupMembersFilterEnum {
return SupergroupMembersFilterBannedType
}
// SupergroupMembersFilterMention Returns users which can be mentioned in the supergroup
type SupergroupMembersFilterMention struct {
tdCommon
Query string `json:"query"` // Query to search for
MessageThreadID int64 `json:"message_thread_id"` // If non-zero, the identifier of the current message thread
}
// MessageType return the string telegram-type of SupergroupMembersFilterMention
func (supergroupMembersFilterMention *SupergroupMembersFilterMention) MessageType() string {
return "supergroupMembersFilterMention"
}
// NewSupergroupMembersFilterMention creates a new SupergroupMembersFilterMention
//
// @param query Query to search for
// @param messageThreadID If non-zero, the identifier of the current message thread
func NewSupergroupMembersFilterMention(query string, messageThreadID int64) *SupergroupMembersFilterMention {
supergroupMembersFilterMentionTemp := SupergroupMembersFilterMention{
tdCommon: tdCommon{Type: "supergroupMembersFilterMention"},
Query: query,
MessageThreadID: messageThreadID,
}
return &supergroupMembersFilterMentionTemp
}
// GetSupergroupMembersFilterEnum return the enum type of this object
func (supergroupMembersFilterMention *SupergroupMembersFilterMention) GetSupergroupMembersFilterEnum() SupergroupMembersFilterEnum {
return SupergroupMembersFilterMentionType
}
// SupergroupMembersFilterBots Returns bot members of the supergroup or channel
type SupergroupMembersFilterBots struct {
tdCommon
}
// MessageType return the string telegram-type of SupergroupMembersFilterBots
func (supergroupMembersFilterBots *SupergroupMembersFilterBots) MessageType() string {
return "supergroupMembersFilterBots"
}
// NewSupergroupMembersFilterBots creates a new SupergroupMembersFilterBots
//
func NewSupergroupMembersFilterBots() *SupergroupMembersFilterBots {
supergroupMembersFilterBotsTemp := SupergroupMembersFilterBots{
tdCommon: tdCommon{Type: "supergroupMembersFilterBots"},
}
return &supergroupMembersFilterBotsTemp
}
// GetSupergroupMembersFilterEnum return the enum type of this object
func (supergroupMembersFilterBots *SupergroupMembersFilterBots) GetSupergroupMembersFilterEnum() SupergroupMembersFilterEnum {
return SupergroupMembersFilterBotsType
}