@telegram.ts/types 1.13.0 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telegram.ts/types",
3
- "version": "1.13.0",
3
+ "version": "1.14.1",
4
4
  "description": "Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -614,7 +614,9 @@ export type ApiMethods = {
614
614
 
615
615
  /** Use this method to send paid media to channel chats. On success, the sent Message is returned. */
616
616
  sendPaidMedia(args: {
617
- /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
617
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
618
+ business_connection_id?: string;
619
+ /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance */
618
620
  chat_id: number | string;
619
621
  /** The number of Telegram Stars that must be paid to buy access to the media */
620
622
  star_count: number;
@@ -825,7 +827,7 @@ export type ApiMethods = {
825
827
  chat_id: number | string;
826
828
  /** Identifier of the target message */
827
829
  message_id: number;
828
- /** A list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. */
830
+ /** A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots. */
829
831
  reaction?: ReactionType[];
830
832
  /** Pass True to set the reaction with a big animation */
831
833
  is_big?: boolean;
@@ -1000,6 +1002,28 @@ export type ApiMethods = {
1000
1002
  creates_join_request?: boolean;
1001
1003
  }): ChatInviteLink;
1002
1004
 
1005
+ /** Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. */
1006
+ createChatSubscriptionInviteLink(args: {
1007
+ /** Unique identifier for the target channel chat or username of the target channel (in the format @channelusername) */
1008
+ chat_id: number | string;
1009
+ /** Invite link name; 0-32 characters */
1010
+ name?: string;
1011
+ /** The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days) */
1012
+ subscription_period: number;
1013
+ /** The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500 */
1014
+ subscription_price: number;
1015
+ }): ChatInviteLink;
1016
+
1017
+ /** Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object. */
1018
+ editChatSubscriptionInviteLink(args: {
1019
+ /** Unique identifier for the target channel chat or username of the target channel (in the format @channelusername) */
1020
+ chat_id: number | string;
1021
+ /** The invite link to edit */
1022
+ invite_link: string;
1023
+ /** Invite link name; 0-32 characters */
1024
+ name?: string;
1025
+ }): ChatInviteLink;
1026
+
1003
1027
  /** Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object. */
1004
1028
  revokeChatInviteLink(args: {
1005
1029
  /** Unique identifier of the target chat or username of the target channel (in the format @channelusername) */
@@ -1,4 +1,5 @@
1
1
  import type { User } from "./manageTypes";
2
+ import type { PaidMedia } from "./messageTypes";
2
3
 
3
4
  /** This object represents a portion of the price for goods or services. */
4
5
  export interface LabeledPrice {
@@ -174,6 +175,8 @@ export interface TransactionPartnerUser {
174
175
  user: User;
175
176
  /** Bot-specified invoice payload */
176
177
  invoice_payload?: string;
178
+ /** Information about the paid media bought by the user */
179
+ paid_media?: PaidMedia[];
177
180
  }
178
181
 
179
182
  /** Describes a withdrawal transaction with Fragment. */
@@ -690,6 +690,8 @@ export interface ChatMemberMember {
690
690
  status: "member";
691
691
  /** Information about the user */
692
692
  user: User;
693
+ /** Date when the user's subscription will expire; Unix time */
694
+ until_date?: number;
693
695
  }
694
696
 
695
697
  /** Represents a chat member that is under certain restrictions in the chat. Supergroups only. */
@@ -15,9 +15,9 @@ export declare namespace Message {
15
15
  message_id: number;
16
16
  /** Unique identifier of a message thread or a forum topic to which the message belongs; for supergroups only */
17
17
  message_thread_id?: number;
18
- /** Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
18
+ /** Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats. */
19
19
  from?: User;
20
- /** Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
20
+ /** Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field *from* contains a fake sender user in non-channel chats. */
21
21
  sender_chat?: Chat;
22
22
  /** Date the message was sent in Unix time. It is always a positive number, representing a valid date. */
23
23
  date: number;
@@ -1335,8 +1335,12 @@ export interface File {
1335
1335
 
1336
1336
  /** This object describes the type of a reaction. Currently, it can be one of
1337
1337
  - ReactionTypeEmoji
1338
- - ReactionTypeCustomEmoji */
1339
- export type ReactionType = ReactionTypeEmoji | ReactionTypeCustomEmoji;
1338
+ - ReactionTypeCustomEmoji
1339
+ - ReactionTypePaid */
1340
+ export type ReactionType =
1341
+ | ReactionTypeEmoji
1342
+ | ReactionTypeCustomEmoji
1343
+ | ReactionTypePaid;
1340
1344
 
1341
1345
  /** The reaction is based on an emoji. */
1342
1346
  export interface ReactionTypeEmoji {
@@ -1427,6 +1431,12 @@ export interface ReactionTypeCustomEmoji {
1427
1431
  custom_emoji: string;
1428
1432
  }
1429
1433
 
1434
+ /** The reaction is paid. */
1435
+ export interface ReactionTypePaid {
1436
+ /** Type of the reaction, always “paid” */
1437
+ type: "paid";
1438
+ }
1439
+
1430
1440
  /** Represents a reaction added to a message along with the number of times it was added. */
1431
1441
  export interface ReactionCount {
1432
1442
  /** Type of the reaction */