@@ -1242,6 +1242,29 @@ func (config InlineConfig) params() (Params, error) {
1242
1242
return params , err
1243
1243
}
1244
1244
1245
+ // AnswerWebAppQueryConfig is used to set the result of an interaction with a
1246
+ // Web App and send a corresponding message on behalf of the user to the chat
1247
+ // from which the query originated.
1248
+ type AnswerWebAppQueryConfig struct {
1249
+ // WebAppQueryID is the unique identifier for the query to be answered.
1250
+ WebAppQueryID string `json:"web_app_query_id"`
1251
+ // Result is an InlineQueryResult object describing the message to be sent.
1252
+ Result interface {} `json:"result"`
1253
+ }
1254
+
1255
+ func (config AnswerWebAppQueryConfig ) method () string {
1256
+ return "answerWebAppQuery"
1257
+ }
1258
+
1259
+ func (config AnswerWebAppQueryConfig ) params () (Params , error ) {
1260
+ params := make (Params )
1261
+
1262
+ params ["web_app_query_id" ] = config .WebAppQueryID
1263
+ err := params .AddInterface ("result" , config .Result )
1264
+
1265
+ return params , err
1266
+ }
1267
+
1245
1268
// CallbackConfig contains information on making a CallbackQuery response.
1246
1269
type CallbackConfig struct {
1247
1270
CallbackQueryID string `json:"callback_query_id"`
@@ -1355,7 +1378,7 @@ type PromoteChatMemberConfig struct {
1355
1378
CanPostMessages bool
1356
1379
CanEditMessages bool
1357
1380
CanDeleteMessages bool
1358
- CanManageVoiceChats bool
1381
+ CanManageVideoChats bool
1359
1382
CanInviteUsers bool
1360
1383
CanRestrictMembers bool
1361
1384
CanPinMessages bool
@@ -1378,7 +1401,7 @@ func (config PromoteChatMemberConfig) params() (Params, error) {
1378
1401
params .AddBool ("can_post_messages" , config .CanPostMessages )
1379
1402
params .AddBool ("can_edit_messages" , config .CanEditMessages )
1380
1403
params .AddBool ("can_delete_messages" , config .CanDeleteMessages )
1381
- params .AddBool ("can_manage_voice_chats " , config .CanManageVoiceChats )
1404
+ params .AddBool ("can_manage_video_chats " , config .CanManageVideoChats )
1382
1405
params .AddBool ("can_invite_users" , config .CanInviteUsers )
1383
1406
params .AddBool ("can_restrict_members" , config .CanRestrictMembers )
1384
1407
params .AddBool ("can_pin_messages" , config .CanPinMessages )
@@ -2315,6 +2338,81 @@ func (config DeleteMyCommandsConfig) params() (Params, error) {
2315
2338
return params , err
2316
2339
}
2317
2340
2341
+ // SetChatMenuButtonConfig changes the bot's menu button in a private chat,
2342
+ // or the default menu button.
2343
+ type SetChatMenuButtonConfig struct {
2344
+ ChatID int64
2345
+ ChannelUsername string
2346
+
2347
+ MenuButton * MenuButton
2348
+ }
2349
+
2350
+ func (config SetChatMenuButtonConfig ) method () string {
2351
+ return "setChatMenuButton"
2352
+ }
2353
+
2354
+ func (config SetChatMenuButtonConfig ) params () (Params , error ) {
2355
+ params := make (Params )
2356
+
2357
+ if err := params .AddFirstValid ("chat_id" , config .ChatID , config .ChannelUsername ); err != nil {
2358
+ return params , err
2359
+ }
2360
+ err := params .AddInterface ("menu_button" , config .MenuButton )
2361
+
2362
+ return params , err
2363
+ }
2364
+
2365
+ type GetChatMenuButtonConfig struct {
2366
+ ChatID int64
2367
+ ChannelUsername string
2368
+ }
2369
+
2370
+ func (config GetChatMenuButtonConfig ) method () string {
2371
+ return "getChatMenuButton"
2372
+ }
2373
+
2374
+ func (config GetChatMenuButtonConfig ) params () (Params , error ) {
2375
+ params := make (Params )
2376
+
2377
+ err := params .AddFirstValid ("chat_id" , config .ChatID , config .ChannelUsername )
2378
+
2379
+ return params , err
2380
+ }
2381
+
2382
+ type SetMyDefaultAdministratorRightsConfig struct {
2383
+ Rights ChatAdministratorRights
2384
+ ForChannels bool
2385
+ }
2386
+
2387
+ func (config SetMyDefaultAdministratorRightsConfig ) method () string {
2388
+ return "setMyDefaultAdministratorRights"
2389
+ }
2390
+
2391
+ func (config SetMyDefaultAdministratorRightsConfig ) params () (Params , error ) {
2392
+ params := make (Params )
2393
+
2394
+ err := params .AddInterface ("rights" , config .Rights )
2395
+ params .AddBool ("for_channels" , config .ForChannels )
2396
+
2397
+ return params , err
2398
+ }
2399
+
2400
+ type GetMyDefaultAdministratorRightsConfig struct {
2401
+ ForChannels bool
2402
+ }
2403
+
2404
+ func (config GetMyDefaultAdministratorRightsConfig ) method () string {
2405
+ return "getMyDefaultAdministratorRights"
2406
+ }
2407
+
2408
+ func (config GetMyDefaultAdministratorRightsConfig ) params () (Params , error ) {
2409
+ params := make (Params )
2410
+
2411
+ params .AddBool ("for_channels" , config .ForChannels )
2412
+
2413
+ return params , nil
2414
+ }
2415
+
2318
2416
// prepareInputMediaParam evaluates a single InputMedia and determines if it
2319
2417
// needs to be modified for a successful upload. If it returns nil, then the
2320
2418
// value does not need to be included in the params. Otherwise, it will return
0 commit comments