@@ -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"`
@@ -2087,12 +2143,14 @@ func (config InvoiceConfig) method() string {
20872143
20882144// InvoiceLinkConfig contains information for createInvoiceLink method
20892145type InvoiceLinkConfig struct {
2146+ BusinessConnectionID BusinessConnectionID
20902147 Title string // Required
20912148 Description string // Required
20922149 Payload string // Required
20932150 ProviderToken string // Required
20942151 Currency string // Required
20952152 Prices []LabeledPrice // Required
2153+ SubscriptionPeriod int
20962154 MaxTipAmount int
20972155 SuggestedTipAmounts []int
20982156 ProviderData string
@@ -2110,7 +2168,10 @@ type InvoiceLinkConfig struct {
21102168}
21112169
21122170func (config InvoiceLinkConfig ) params () (Params , error ) {
2113- params := make (Params )
2171+ params , err := config .BusinessConnectionID .params ()
2172+ if err != nil {
2173+ return params , err
2174+ }
21142175
21152176 params ["title" ] = config .Title
21162177 params ["description" ] = config .Description
@@ -2120,6 +2181,7 @@ func (config InvoiceLinkConfig) params() (Params, error) {
21202181 return params , err
21212182 }
21222183
2184+ params .AddNonZero ("subscription_period" , config .SubscriptionPeriod )
21232185 params .AddNonEmpty ("provider_token" , config .ProviderToken )
21242186 params .AddNonZero ("max_tip_amount" , config .MaxTipAmount )
21252187 if len (config .SuggestedTipAmounts ) > 0 {
@@ -2233,6 +2295,28 @@ func (config RefundStarPaymentConfig) params() (Params, error) {
22332295 return params , nil
22342296}
22352297
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+
22362320// DeleteMessageConfig contains information of a message in a chat to delete.
22372321type DeleteMessageConfig struct {
22382322 BaseChatMessage
@@ -2259,6 +2343,54 @@ func (config DeleteMessagesConfig) params() (Params, error) {
22592343 return config .BaseChatMessages .params ()
22602344}
22612345
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+
22622394// PinChatMessageConfig contains information of a message in a chat to pin.
22632395type PinChatMessageConfig struct {
22642396 BaseChatMessage
0 commit comments