@@ -1331,6 +1331,30 @@ func (config UserProfilePhotosConfig) params() (Params, error) {
1331
1331
return params , nil
1332
1332
}
1333
1333
1334
+ // SetUserEmojiStatusConfig changes the emoji status for a given user that
1335
+ // previously allowed the bot to manage their emoji status via
1336
+ // the Mini App method requestEmojiStatusAccess.
1337
+ // Returns True on success.
1338
+ type SetUserEmojiStatusConfig struct {
1339
+ UserID int64 // required
1340
+ EmojiStatusCustomEmojiID string
1341
+ EmojiStatusExpirationDate int64
1342
+ }
1343
+
1344
+ func (SetUserEmojiStatusConfig ) method () string {
1345
+ return "setUserEmojiStatus"
1346
+ }
1347
+
1348
+ func (config SetUserEmojiStatusConfig ) params () (Params , error ) {
1349
+ params := make (Params )
1350
+
1351
+ params .AddNonZero64 ("user_id" , config .UserID )
1352
+ params .AddNonEmpty ("emoji_status_custom_emoji_id" , config .EmojiStatusCustomEmojiID )
1353
+ params .AddNonZero64 ("emoji_status_expiration_date " , config .EmojiStatusExpirationDate )
1354
+
1355
+ return params , nil
1356
+ }
1357
+
1334
1358
// FileConfig has information about a file hosted on Telegram.
1335
1359
type FileConfig struct {
1336
1360
FileID string
@@ -1497,6 +1521,38 @@ func (config AnswerWebAppQueryConfig) params() (Params, error) {
1497
1521
return params , err
1498
1522
}
1499
1523
1524
+ // SavePreparedInlineMessageConfig stores a message that can be sent by a user of a Mini App.
1525
+ // Returns a PreparedInlineMessage object.
1526
+ type SavePreparedInlineMessageConfig [T InlineQueryResults ] struct {
1527
+ UserID int64 // required
1528
+ Result T // required
1529
+ AllowUserChats bool
1530
+ AllowBotChats bool
1531
+ AllowGroupChats bool
1532
+ AllowChannelChats bool
1533
+ }
1534
+
1535
+ func (config SavePreparedInlineMessageConfig [T ]) method () string {
1536
+ return "savePreparedInlineMessage"
1537
+ }
1538
+
1539
+ func (config SavePreparedInlineMessageConfig [T ]) params () (Params , error ) {
1540
+ params := make (Params )
1541
+
1542
+ params .AddNonZero64 ("user_id" , config .UserID )
1543
+ err := params .AddInterface ("result" , config .Result )
1544
+ if err != nil {
1545
+ return params , err
1546
+ }
1547
+
1548
+ params .AddBool ("allow_user_chats" , config .AllowUserChats )
1549
+ params .AddBool ("allow_bot_chats" , config .AllowBotChats )
1550
+ params .AddBool ("allow_group_chats" , config .AllowGroupChats )
1551
+ params .AddBool ("allow_channel_chats" , config .AllowChannelChats )
1552
+
1553
+ return params , err
1554
+ }
1555
+
1500
1556
// CallbackConfig contains information on making a CallbackQuery response.
1501
1557
type CallbackConfig struct {
1502
1558
CallbackQueryID string `json:"callback_query_id"`
@@ -2087,12 +2143,14 @@ func (config InvoiceConfig) method() string {
2087
2143
2088
2144
// InvoiceLinkConfig contains information for createInvoiceLink method
2089
2145
type InvoiceLinkConfig struct {
2146
+ BusinessConnectionID BusinessConnectionID
2090
2147
Title string // Required
2091
2148
Description string // Required
2092
2149
Payload string // Required
2093
2150
ProviderToken string // Required
2094
2151
Currency string // Required
2095
2152
Prices []LabeledPrice // Required
2153
+ SubscriptionPeriod int
2096
2154
MaxTipAmount int
2097
2155
SuggestedTipAmounts []int
2098
2156
ProviderData string
@@ -2110,7 +2168,10 @@ type InvoiceLinkConfig struct {
2110
2168
}
2111
2169
2112
2170
func (config InvoiceLinkConfig ) params () (Params , error ) {
2113
- params := make (Params )
2171
+ params , err := config .BusinessConnectionID .params ()
2172
+ if err != nil {
2173
+ return params , err
2174
+ }
2114
2175
2115
2176
params ["title" ] = config .Title
2116
2177
params ["description" ] = config .Description
@@ -2120,6 +2181,7 @@ func (config InvoiceLinkConfig) params() (Params, error) {
2120
2181
return params , err
2121
2182
}
2122
2183
2184
+ params .AddNonZero ("subscription_period" , config .SubscriptionPeriod )
2123
2185
params .AddNonEmpty ("provider_token" , config .ProviderToken )
2124
2186
params .AddNonZero ("max_tip_amount" , config .MaxTipAmount )
2125
2187
if len (config .SuggestedTipAmounts ) > 0 {
@@ -2233,6 +2295,28 @@ func (config RefundStarPaymentConfig) params() (Params, error) {
2233
2295
return params , nil
2234
2296
}
2235
2297
2298
+ // EditUserStarSubscriptionConfig allows the bot to cancel or re-enable extension
2299
+ // of a subscription paid in Telegram Stars. Returns True on success.
2300
+ type EditUserStarSubscriptionConfig struct {
2301
+ UserID int64 // required
2302
+ TelegramPaymentChargeID string // required
2303
+ IsCanceled bool // required
2304
+ }
2305
+
2306
+ func (config EditUserStarSubscriptionConfig ) method () string {
2307
+ return "editUserStarSubscription"
2308
+ }
2309
+
2310
+ func (config EditUserStarSubscriptionConfig ) params () (Params , error ) {
2311
+ params := make (Params )
2312
+
2313
+ params ["telegram_payment_charge_id" ] = config .TelegramPaymentChargeID
2314
+ params .AddNonZero64 ("user_id" , config .UserID )
2315
+ params .AddBool ("is_canceled" , config .IsCanceled )
2316
+
2317
+ return params , nil
2318
+ }
2319
+
2236
2320
// DeleteMessageConfig contains information of a message in a chat to delete.
2237
2321
type DeleteMessageConfig struct {
2238
2322
BaseChatMessage
@@ -2259,6 +2343,54 @@ func (config DeleteMessagesConfig) params() (Params, error) {
2259
2343
return config .BaseChatMessages .params ()
2260
2344
}
2261
2345
2346
+ // GetAvailableGiftsConfig returns the list of gifts that can be sent by the bot
2347
+ // to users and channel chats. Requires no parameters. Returns a Gifts object.
2348
+ type GetAvailableGiftsConfig struct {}
2349
+
2350
+ func (config GetAvailableGiftsConfig ) method () string {
2351
+ return "getAvailableGifts"
2352
+ }
2353
+
2354
+ func (config GetAvailableGiftsConfig ) params () (Params , error ) {
2355
+ return nil , nil
2356
+ }
2357
+
2358
+ // SendGiftConfig sends a gift to the given user or channel chat.
2359
+ // The gift can't be converted to Telegram Stars by the receiver.
2360
+ // Returns True on success.
2361
+ type SendGiftConfig struct {
2362
+ UserID int64
2363
+ Chat ChatConfig
2364
+ GiftID string // required
2365
+ PayForUpgrade bool
2366
+ Text string
2367
+ TextParseMode string
2368
+ TextEntities []MessageEntity
2369
+ }
2370
+
2371
+ func (config SendGiftConfig ) method () string {
2372
+ return "sendGift"
2373
+ }
2374
+
2375
+ func (config SendGiftConfig ) params () (Params , error ) {
2376
+ params := make (Params )
2377
+ params .AddNonZero64 ("user_id" , config .UserID )
2378
+
2379
+ p1 , err := config .Chat .params ()
2380
+ if err != nil {
2381
+ return params , err
2382
+ }
2383
+ params .Merge (p1 )
2384
+
2385
+ params .AddNonEmpty ("gift_id" , config .GiftID )
2386
+ params .AddBool ("pay_for_upgrade" , config .PayForUpgrade )
2387
+ params .AddNonEmpty ("text" , config .Text )
2388
+ params .AddNonEmpty ("text_parse_mode" , config .Text )
2389
+ params .AddInterface ("text_entities" , config .TextEntities )
2390
+
2391
+ return params , nil
2392
+ }
2393
+
2262
2394
// PinChatMessageConfig contains information of a message in a chat to pin.
2263
2395
type PinChatMessageConfig struct {
2264
2396
BaseChatMessage
0 commit comments