forked from PaulSonOfLars/gotgbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen_helpers.go
executable file
·334 lines (267 loc) · 10.8 KB
/
gen_helpers.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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
// Regen by running 'go generate' in the repo root.
package gotgbot
// Answer Helper method for Bot.AnswerCallbackQuery
func (cq CallbackQuery) Answer(b *Bot, opts *AnswerCallbackQueryOpts) (bool, error) {
return b.AnswerCallbackQuery(cq.Id, opts)
}
// Answer Helper method for Bot.AnswerInlineQuery
func (iq InlineQuery) Answer(b *Bot, results []InlineQueryResult, opts *AnswerInlineQueryOpts) (bool, error) {
return b.AnswerInlineQuery(iq.Id, results, opts)
}
// Answer Helper method for Bot.AnswerPreCheckoutQuery
func (pcq PreCheckoutQuery) Answer(b *Bot, ok bool, opts *AnswerPreCheckoutQueryOpts) (bool, error) {
return b.AnswerPreCheckoutQuery(pcq.Id, ok, opts)
}
// Answer Helper method for Bot.AnswerShippingQuery
func (sq ShippingQuery) Answer(b *Bot, ok bool, opts *AnswerShippingQueryOpts) (bool, error) {
return b.AnswerShippingQuery(sq.Id, ok, opts)
}
// ApproveJoinRequest Helper method for Bot.ApproveChatJoinRequest
func (c Chat) ApproveJoinRequest(b *Bot, userId int64, opts *ApproveChatJoinRequestOpts) (bool, error) {
return b.ApproveChatJoinRequest(c.Id, userId, opts)
}
// BanMember Helper method for Bot.BanChatMember
func (c Chat) BanMember(b *Bot, userId int64, opts *BanChatMemberOpts) (bool, error) {
return b.BanChatMember(c.Id, userId, opts)
}
// BanSenderChat Helper method for Bot.BanChatSenderChat
func (c Chat) BanSenderChat(b *Bot, senderChatId int64, opts *BanChatSenderChatOpts) (bool, error) {
return b.BanChatSenderChat(c.Id, senderChatId, opts)
}
// Copy Helper method for Bot.CopyMessage
func (m Message) Copy(b *Bot, chatId int64, opts *CopyMessageOpts) (*MessageId, error) {
return b.CopyMessage(chatId, m.Chat.Id, m.MessageId, opts)
}
// CreateInviteLink Helper method for Bot.CreateChatInviteLink
func (c Chat) CreateInviteLink(b *Bot, opts *CreateChatInviteLinkOpts) (*ChatInviteLink, error) {
return b.CreateChatInviteLink(c.Id, opts)
}
// DeclineJoinRequest Helper method for Bot.DeclineChatJoinRequest
func (c Chat) DeclineJoinRequest(b *Bot, userId int64, opts *DeclineChatJoinRequestOpts) (bool, error) {
return b.DeclineChatJoinRequest(c.Id, userId, opts)
}
// DeletePhoto Helper method for Bot.DeleteChatPhoto
func (c Chat) DeletePhoto(b *Bot, opts *DeleteChatPhotoOpts) (bool, error) {
return b.DeleteChatPhoto(c.Id, opts)
}
// DeleteStickerSet Helper method for Bot.DeleteChatStickerSet
func (c Chat) DeleteStickerSet(b *Bot, opts *DeleteChatStickerSetOpts) (bool, error) {
return b.DeleteChatStickerSet(c.Id, opts)
}
// Delete Helper method for Bot.DeleteMessage
func (m Message) Delete(b *Bot, opts *DeleteMessageOpts) (bool, error) {
return b.DeleteMessage(m.Chat.Id, m.MessageId, opts)
}
// EditInviteLink Helper method for Bot.EditChatInviteLink
func (c Chat) EditInviteLink(b *Bot, inviteLink string, opts *EditChatInviteLinkOpts) (*ChatInviteLink, error) {
return b.EditChatInviteLink(c.Id, inviteLink, opts)
}
// EditCaption Helper method for Bot.EditMessageCaption
func (m Message) EditCaption(b *Bot, opts *EditMessageCaptionOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageCaptionOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = m.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = m.MessageId
}
return b.EditMessageCaption(opts)
}
// EditLiveLocation Helper method for Bot.EditMessageLiveLocation
func (m Message) EditLiveLocation(b *Bot, latitude float64, longitude float64, opts *EditMessageLiveLocationOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageLiveLocationOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = m.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = m.MessageId
}
return b.EditMessageLiveLocation(latitude, longitude, opts)
}
// EditMedia Helper method for Bot.EditMessageMedia
func (m Message) EditMedia(b *Bot, media InputMedia, opts *EditMessageMediaOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageMediaOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = m.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = m.MessageId
}
return b.EditMessageMedia(media, opts)
}
// EditReplyMarkup Helper method for Bot.EditMessageReplyMarkup
func (m Message) EditReplyMarkup(b *Bot, opts *EditMessageReplyMarkupOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageReplyMarkupOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = m.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = m.MessageId
}
return b.EditMessageReplyMarkup(opts)
}
// EditText Helper method for Bot.EditMessageText
func (m Message) EditText(b *Bot, text string, opts *EditMessageTextOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageTextOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = m.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = m.MessageId
}
return b.EditMessageText(text, opts)
}
// ExportInviteLink Helper method for Bot.ExportChatInviteLink
func (c Chat) ExportInviteLink(b *Bot, opts *ExportChatInviteLinkOpts) (string, error) {
return b.ExportChatInviteLink(c.Id, opts)
}
// Forward Helper method for Bot.ForwardMessage
func (m Message) Forward(b *Bot, chatId int64, opts *ForwardMessageOpts) (*Message, error) {
return b.ForwardMessage(chatId, m.Chat.Id, m.MessageId, opts)
}
// Get Helper method for Bot.GetChat
func (c Chat) Get(b *Bot, opts *GetChatOpts) (*Chat, error) {
return b.GetChat(c.Id, opts)
}
// GetAdministrators Helper method for Bot.GetChatAdministrators
func (c Chat) GetAdministrators(b *Bot, opts *GetChatAdministratorsOpts) ([]ChatMember, error) {
return b.GetChatAdministrators(c.Id, opts)
}
// GetMember Helper method for Bot.GetChatMember
func (c Chat) GetMember(b *Bot, userId int64, opts *GetChatMemberOpts) (ChatMember, error) {
return b.GetChatMember(c.Id, userId, opts)
}
// GetMemberCount Helper method for Bot.GetChatMemberCount
func (c Chat) GetMemberCount(b *Bot, opts *GetChatMemberCountOpts) (int64, error) {
return b.GetChatMemberCount(c.Id, opts)
}
// GetMenuButton Helper method for Bot.GetChatMenuButton
func (c Chat) GetMenuButton(b *Bot, opts *GetChatMenuButtonOpts) (MenuButton, error) {
if opts == nil {
opts = &GetChatMenuButtonOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = c.Id
}
return b.GetChatMenuButton(opts)
}
// Get Helper method for Bot.GetFile
func (f File) Get(b *Bot, opts *GetFileOpts) (*File, error) {
return b.GetFile(f.FileId, opts)
}
// GetProfilePhotos Helper method for Bot.GetUserProfilePhotos
func (u User) GetProfilePhotos(b *Bot, opts *GetUserProfilePhotosOpts) (*UserProfilePhotos, error) {
return b.GetUserProfilePhotos(u.Id, opts)
}
// Leave Helper method for Bot.LeaveChat
func (c Chat) Leave(b *Bot, opts *LeaveChatOpts) (bool, error) {
return b.LeaveChat(c.Id, opts)
}
// PinMessage Helper method for Bot.PinChatMessage
func (c Chat) PinMessage(b *Bot, messageId int64, opts *PinChatMessageOpts) (bool, error) {
return b.PinChatMessage(c.Id, messageId, opts)
}
// Pin Helper method for Bot.PinChatMessage
func (m Message) Pin(b *Bot, opts *PinChatMessageOpts) (bool, error) {
return b.PinChatMessage(m.Chat.Id, m.MessageId, opts)
}
// PromoteMember Helper method for Bot.PromoteChatMember
func (c Chat) PromoteMember(b *Bot, userId int64, opts *PromoteChatMemberOpts) (bool, error) {
return b.PromoteChatMember(c.Id, userId, opts)
}
// RestrictMember Helper method for Bot.RestrictChatMember
func (c Chat) RestrictMember(b *Bot, userId int64, permissions ChatPermissions, opts *RestrictChatMemberOpts) (bool, error) {
return b.RestrictChatMember(c.Id, userId, permissions, opts)
}
// RevokeInviteLink Helper method for Bot.RevokeChatInviteLink
func (c Chat) RevokeInviteLink(b *Bot, inviteLink string, opts *RevokeChatInviteLinkOpts) (*ChatInviteLink, error) {
return b.RevokeChatInviteLink(c.Id, inviteLink, opts)
}
// SendAction Helper method for Bot.SendChatAction
func (c Chat) SendAction(b *Bot, action string, opts *SendChatActionOpts) (bool, error) {
return b.SendChatAction(c.Id, action, opts)
}
// SetAdministratorCustomTitle Helper method for Bot.SetChatAdministratorCustomTitle
func (c Chat) SetAdministratorCustomTitle(b *Bot, userId int64, customTitle string, opts *SetChatAdministratorCustomTitleOpts) (bool, error) {
return b.SetChatAdministratorCustomTitle(c.Id, userId, customTitle, opts)
}
// SetDescription Helper method for Bot.SetChatDescription
func (c Chat) SetDescription(b *Bot, opts *SetChatDescriptionOpts) (bool, error) {
return b.SetChatDescription(c.Id, opts)
}
// SetMenuButton Helper method for Bot.SetChatMenuButton
func (c Chat) SetMenuButton(b *Bot, opts *SetChatMenuButtonOpts) (bool, error) {
if opts == nil {
opts = &SetChatMenuButtonOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = c.Id
}
return b.SetChatMenuButton(opts)
}
// SetPermissions Helper method for Bot.SetChatPermissions
func (c Chat) SetPermissions(b *Bot, permissions ChatPermissions, opts *SetChatPermissionsOpts) (bool, error) {
return b.SetChatPermissions(c.Id, permissions, opts)
}
// SetPhoto Helper method for Bot.SetChatPhoto
func (c Chat) SetPhoto(b *Bot, photo InputFile, opts *SetChatPhotoOpts) (bool, error) {
return b.SetChatPhoto(c.Id, photo, opts)
}
// SetStickerSet Helper method for Bot.SetChatStickerSet
func (c Chat) SetStickerSet(b *Bot, stickerSetName string, opts *SetChatStickerSetOpts) (bool, error) {
return b.SetChatStickerSet(c.Id, stickerSetName, opts)
}
// SetTitle Helper method for Bot.SetChatTitle
func (c Chat) SetTitle(b *Bot, title string, opts *SetChatTitleOpts) (bool, error) {
return b.SetChatTitle(c.Id, title, opts)
}
// StopLiveLocation Helper method for Bot.StopMessageLiveLocation
func (m Message) StopLiveLocation(b *Bot, opts *StopMessageLiveLocationOpts) (*Message, bool, error) {
if opts == nil {
opts = &StopMessageLiveLocationOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = m.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = m.MessageId
}
return b.StopMessageLiveLocation(opts)
}
// UnbanMember Helper method for Bot.UnbanChatMember
func (c Chat) UnbanMember(b *Bot, userId int64, opts *UnbanChatMemberOpts) (bool, error) {
return b.UnbanChatMember(c.Id, userId, opts)
}
// UnbanSenderChat Helper method for Bot.UnbanChatSenderChat
func (c Chat) UnbanSenderChat(b *Bot, senderChatId int64, opts *UnbanChatSenderChatOpts) (bool, error) {
return b.UnbanChatSenderChat(c.Id, senderChatId, opts)
}
// UnpinAllMessages Helper method for Bot.UnpinAllChatMessages
func (c Chat) UnpinAllMessages(b *Bot, opts *UnpinAllChatMessagesOpts) (bool, error) {
return b.UnpinAllChatMessages(c.Id, opts)
}
// UnpinMessage Helper method for Bot.UnpinChatMessage
func (c Chat) UnpinMessage(b *Bot, opts *UnpinChatMessageOpts) (bool, error) {
return b.UnpinChatMessage(c.Id, opts)
}
// Unpin Helper method for Bot.UnpinChatMessage
func (m Message) Unpin(b *Bot, opts *UnpinChatMessageOpts) (bool, error) {
if opts == nil {
opts = &UnpinChatMessageOpts{}
}
if opts.MessageId == 0 {
opts.MessageId = m.MessageId
}
return b.UnpinChatMessage(m.Chat.Id, opts)
}