@@ -64,6 +64,7 @@ import {
6464 InputPaidMedia ,
6565 WebhookInfo ,
6666 Currencies ,
67+ Gifts ,
6768} from './types/' ;
6869import * as TelegramTypes from './types/' ;
6970
@@ -1157,6 +1158,20 @@ export class TelegramBot extends EventEmitter {
11571158 return await this . callApi ( 'getUserProfilePhotos' , options ) ;
11581159 }
11591160
1161+ /**
1162+ * ## setUserEmojiStatus
1163+ * Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the
1164+ * Mini App method requestEmojiStatusAccess. Returns True on success.
1165+ * @see https://core.telegram.org/bots/api#setuseremojistatus
1166+ */
1167+ async setUserEmojiStatus ( options : {
1168+ user_id : number ;
1169+ emoji_status_custom_emoji_id ?: string ;
1170+ emoji_status_expiration_date ?: number ;
1171+ } ) : Promise < boolean > {
1172+ return await this . callApi ( 'setUserEmojiStatus' , options ) ;
1173+ }
1174+
11601175 /**
11611176 * ## getFile
11621177 * Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can
@@ -2388,12 +2403,14 @@ export class TelegramBot extends EventEmitter {
23882403 * @see https://core.telegram.org/bots/api#createinvoicelink
23892404 */
23902405 async createInvoiceLink < T extends Currencies | 'XTR' > ( options : {
2406+ business_connection_id ?: string ;
23912407 title : string ;
23922408 description : string ;
23932409 payload : string ;
23942410 provider_token ?: string ;
23952411 currency : T ;
23962412 prices : T extends 'XTR' ? [ LabeledPrice ] : LabeledPrice [ ] ;
2413+ subscription_period ?: T extends 'XTR' ? number : never ;
23972414 max_tip_amount ?: T extends 'XTR' ? never : number ;
23982415 suggested_tip_amounts ?: number [ ] ;
23992416 provider_data ?: string ;
@@ -2476,6 +2493,19 @@ export class TelegramBot extends EventEmitter {
24762493 return await this . callApi ( 'refundStarPayment' , options ) ;
24772494 }
24782495
2496+ /**
2497+ * ## editUserStarSubscription
2498+ * Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.
2499+ * @see https://core.telegram.org/bots/api#edituserstarsubscription
2500+ */
2501+ async editUserStarSubscription ( options : {
2502+ user_id : number ;
2503+ telegram_payment_charge_id : string ;
2504+ is_canceled : boolean ;
2505+ } ) : Promise < true > {
2506+ return await this . callApi ( 'editUserStarSubscription' , options ) ;
2507+ }
2508+
24792509 /**
24802510 * ## setPassportDataErrors
24812511 * Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able
@@ -2557,6 +2587,33 @@ export class TelegramBot extends EventEmitter {
25572587 return await this . callApi ( 'getGameHighScores' , options ) ;
25582588 }
25592589
2590+ /**
2591+ * ## getAvailableGifts
2592+ * Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a Gifts object.
2593+ * @see https://core.telegram.org/bots/api#getavailablegifts
2594+ */
2595+ async getAvailableGifts ( ) : Promise < Gifts > {
2596+ return await this . callApi ( 'getAvailableGifts' ) ;
2597+ }
2598+
2599+ /**
2600+ * ## sendGift
2601+ * Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success.
2602+ * @see https://core.telegram.org/bots/api#sendgift
2603+ */
2604+ async sendGift ( options : {
2605+ user_id : number ;
2606+ gift_id : string ;
2607+ text ?: string ;
2608+ text_parse_mode ?: ParseMode ;
2609+ text_entities ?: MessageEntity [ ] ;
2610+ } ) : Promise < true > {
2611+ return await this . callApi ( 'sendGift' , {
2612+ ...options ,
2613+ text_entities : new JSONSerialized ( options . text_entities ) ,
2614+ } ) ;
2615+ }
2616+
25602617 on < U extends keyof allEmittedTypes > ( event : U , listener : ( eventData : NonNullable < allEmittedTypes [ U ] > ) => void ) : this {
25612618 return super . on ( event , listener ) as this;
25622619 }
0 commit comments