@@ -1331,6 +1331,30 @@ func (config UserProfilePhotosConfig) params() (Params, error) {
13311331 return params , nil
13321332}
13331333
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+
13341358// FileConfig has information about a file hosted on Telegram.
13351359type FileConfig struct {
13361360 FileID string
@@ -1497,6 +1521,38 @@ func (config AnswerWebAppQueryConfig) params() (Params, error) {
14971521 return params , err
14981522}
14991523
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+
15001556// CallbackConfig contains information on making a CallbackQuery response.
15011557type CallbackConfig struct {
15021558 CallbackQueryID string `json:"callback_query_id"`
@@ -2082,12 +2138,14 @@ func (config InvoiceConfig) method() string {
20822138
20832139// InvoiceLinkConfig contains information for createInvoiceLink method
20842140type InvoiceLinkConfig struct {
2141+ BusinessConnectionID BusinessConnectionID
20852142 Title string // Required
20862143 Description string // Required
20872144 Payload string // Required
20882145 ProviderToken string // Required
20892146 Currency string // Required
20902147 Prices []LabeledPrice // Required
2148+ SubscriptionPeriod int
20912149 MaxTipAmount int
20922150 SuggestedTipAmounts []int
20932151 ProviderData string
@@ -2105,7 +2163,10 @@ type InvoiceLinkConfig struct {
21052163}
21062164
21072165func (config InvoiceLinkConfig ) params () (Params , error ) {
2108- params := make (Params )
2166+ params , err := config .BusinessConnectionID .params ()
2167+ if err != nil {
2168+ return params , err
2169+ }
21092170
21102171 params ["title" ] = config .Title
21112172 params ["description" ] = config .Description
@@ -2115,9 +2176,13 @@ func (config InvoiceLinkConfig) params() (Params, error) {
21152176 return params , err
21162177 }
21172178
2179+ params .AddNonZero ("subscription_period" , config .SubscriptionPeriod )
21182180 params .AddNonEmpty ("provider_token" , config .ProviderToken )
21192181 params .AddNonZero ("max_tip_amount" , config .MaxTipAmount )
2120- err := params .AddInterface ("suggested_tip_amounts" , config .SuggestedTipAmounts )
2182+ err = params .AddInterface ("suggested_tip_amounts" , config .SuggestedTipAmounts )
2183+ if err != nil {
2184+ return params , err
2185+ }
21212186 params .AddNonEmpty ("provider_data" , config .ProviderData )
21222187 params .AddNonEmpty ("photo_url" , config .PhotoURL )
21232188 params .AddNonZero ("photo_size" , config .PhotoSize )
@@ -2223,6 +2288,28 @@ func (config RefundStarPaymentConfig) params() (Params, error) {
22232288 return params , nil
22242289}
22252290
2291+ // EditUserStarSubscriptionConfig allows the bot to cancel or re-enable extension
2292+ // of a subscription paid in Telegram Stars. Returns True on success.
2293+ type EditUserStarSubscriptionConfig struct {
2294+ UserID int64 // required
2295+ TelegramPaymentChargeID string // required
2296+ IsCanceled bool // required
2297+ }
2298+
2299+ func (config EditUserStarSubscriptionConfig ) method () string {
2300+ return "editUserStarSubscription"
2301+ }
2302+
2303+ func (config EditUserStarSubscriptionConfig ) params () (Params , error ) {
2304+ params := make (Params )
2305+
2306+ params ["telegram_payment_charge_id" ] = config .TelegramPaymentChargeID
2307+ params .AddNonZero64 ("user_id" , config .UserID )
2308+ params .AddBool ("is_canceled" , config .IsCanceled )
2309+
2310+ return params , nil
2311+ }
2312+
22262313// DeleteMessageConfig contains information of a message in a chat to delete.
22272314type DeleteMessageConfig struct {
22282315 BaseChatMessage
@@ -2249,6 +2336,54 @@ func (config DeleteMessagesConfig) params() (Params, error) {
22492336 return config .BaseChatMessages .params ()
22502337}
22512338
2339+ // GetAvailableGiftsConfig returns the list of gifts that can be sent by the bot
2340+ // to users and channel chats. Requires no parameters. Returns a Gifts object.
2341+ type GetAvailableGiftsConfig struct {}
2342+
2343+ func (config GetAvailableGiftsConfig ) method () string {
2344+ return "getAvailableGifts"
2345+ }
2346+
2347+ func (config GetAvailableGiftsConfig ) params () (Params , error ) {
2348+ return nil , nil
2349+ }
2350+
2351+ // SendGiftConfig sends a gift to the given user or channel chat.
2352+ // The gift can't be converted to Telegram Stars by the receiver.
2353+ // Returns True on success.
2354+ type SendGiftConfig struct {
2355+ UserID int64
2356+ Chat ChatConfig
2357+ GiftID string // required
2358+ PayForUpgrade bool
2359+ Text string
2360+ TextParseMode string
2361+ TextEntities []MessageEntity
2362+ }
2363+
2364+ func (config SendGiftConfig ) method () string {
2365+ return "sendGift"
2366+ }
2367+
2368+ func (config SendGiftConfig ) params () (Params , error ) {
2369+ params := make (Params )
2370+ params .AddNonZero64 ("user_id" , config .UserID )
2371+
2372+ p1 , err := config .Chat .params ()
2373+ if err != nil {
2374+ return params , err
2375+ }
2376+ params .Merge (p1 )
2377+
2378+ params .AddNonEmpty ("gift_id" , config .GiftID )
2379+ params .AddBool ("pay_for_upgrade" , config .PayForUpgrade )
2380+ params .AddNonEmpty ("text" , config .Text )
2381+ params .AddNonEmpty ("text_parse_mode" , config .Text )
2382+ params .AddInterface ("text_entities" , config .TextEntities )
2383+
2384+ return params , nil
2385+ }
2386+
22522387// PinChatMessageConfig contains information of a message in a chat to pin.
22532388type PinChatMessageConfig struct {
22542389 BaseChatMessage
0 commit comments