@@ -29,6 +29,7 @@ const (
29
29
// Deprecated: use ChatUploadVoice instead.
30
30
ChatUploadAudio = "upload_audio"
31
31
ChatUploadDocument = "upload_document"
32
+ ChatChooseSticker = "choose_sticker"
32
33
ChatFindLocation = "find_location"
33
34
ChatRecordVideoNote = "record_video_note"
34
35
ChatUploadVideoNote = "upload_video_note"
@@ -1395,8 +1396,10 @@ func (config ChatInviteLinkConfig) params() (Params, error) {
1395
1396
// RevokeChatInviteLinkConfig.
1396
1397
type CreateChatInviteLinkConfig struct {
1397
1398
ChatConfig
1398
- ExpireDate int
1399
- MemberLimit int
1399
+ Name string
1400
+ ExpireDate int
1401
+ MemberLimit int
1402
+ CreatesJoinRequest bool
1400
1403
}
1401
1404
1402
1405
func (CreateChatInviteLinkConfig ) method () string {
@@ -1406,9 +1409,11 @@ func (CreateChatInviteLinkConfig) method() string {
1406
1409
func (config CreateChatInviteLinkConfig ) params () (Params , error ) {
1407
1410
params := make (Params )
1408
1411
1412
+ params .AddNonEmpty ("name" , config .Name )
1409
1413
params .AddFirstValid ("chat_id" , config .ChatID , config .SuperGroupUsername )
1410
1414
params .AddNonZero ("expire_date" , config .ExpireDate )
1411
1415
params .AddNonZero ("member_limit" , config .MemberLimit )
1416
+ params .AddBool ("creates_join_request" , config .CreatesJoinRequest )
1412
1417
1413
1418
return params , nil
1414
1419
}
@@ -1418,9 +1423,11 @@ func (config CreateChatInviteLinkConfig) params() (Params, error) {
1418
1423
// must have the appropriate admin rights.
1419
1424
type EditChatInviteLinkConfig struct {
1420
1425
ChatConfig
1421
- InviteLink string
1422
- ExpireDate int
1423
- MemberLimit int
1426
+ InviteLink string
1427
+ Name string
1428
+ ExpireDate int
1429
+ MemberLimit int
1430
+ CreatesJoinRequest bool
1424
1431
}
1425
1432
1426
1433
func (EditChatInviteLinkConfig ) method () string {
@@ -1431,9 +1438,11 @@ func (config EditChatInviteLinkConfig) params() (Params, error) {
1431
1438
params := make (Params )
1432
1439
1433
1440
params .AddFirstValid ("chat_id" , config .ChatID , config .SuperGroupUsername )
1441
+ params .AddNonEmpty ("name" , config .Name )
1434
1442
params ["invite_link" ] = config .InviteLink
1435
1443
params .AddNonZero ("expire_date" , config .ExpireDate )
1436
1444
params .AddNonZero ("member_limit" , config .MemberLimit )
1445
+ params .AddBool ("creates_join_request" , config .CreatesJoinRequest )
1437
1446
1438
1447
return params , nil
1439
1448
}
@@ -1460,6 +1469,44 @@ func (config RevokeChatInviteLinkConfig) params() (Params, error) {
1460
1469
return params , nil
1461
1470
}
1462
1471
1472
+ // ApproveChatJoinRequestConfig allows you to approve a chat join request.
1473
+ type ApproveChatJoinRequestConfig struct {
1474
+ ChatConfig
1475
+ UserID int64
1476
+ }
1477
+
1478
+ func (ApproveChatJoinRequestConfig ) method () string {
1479
+ return "approveChatJoinRequest"
1480
+ }
1481
+
1482
+ func (config ApproveChatJoinRequestConfig ) params () (Params , error ) {
1483
+ params := make (Params )
1484
+
1485
+ params .AddFirstValid ("chat_id" , config .ChatID , config .SuperGroupUsername )
1486
+ params .AddNonZero ("user_id" , int (config .UserID ))
1487
+
1488
+ return params , nil
1489
+ }
1490
+
1491
+ // DeclineChatJoinRequest allows you to decline a chat join request.
1492
+ type DeclineChatJoinRequest struct {
1493
+ ChatConfig
1494
+ UserID int64
1495
+ }
1496
+
1497
+ func (DeclineChatJoinRequest ) method () string {
1498
+ return "declineChatJoinRequest"
1499
+ }
1500
+
1501
+ func (config DeclineChatJoinRequest ) params () (Params , error ) {
1502
+ params := make (Params )
1503
+
1504
+ params .AddFirstValid ("chat_id" , config .ChatID , config .SuperGroupUsername )
1505
+ params .AddNonZero ("user_id" , int (config .UserID ))
1506
+
1507
+ return params , nil
1508
+ }
1509
+
1463
1510
// LeaveChatConfig allows you to leave a chat.
1464
1511
type LeaveChatConfig struct {
1465
1512
ChatID int64
0 commit comments