@tgify/types 9.2.4 → 9.4.0

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/manage.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Audio } from './message';
1
2
  import type { Location, Message, MessageEntity, PhotoSize, Sticker } from "./message.js";
2
3
  /** Describes the current status of a webhook. */
3
4
  export interface WebhookInfo {
@@ -53,6 +54,8 @@ export interface UserFromGetMe extends User {
53
54
  can_connect_to_business?: boolean;
54
55
  /** True, if the bot has a main Web App. Returned only in getMe. */
55
56
  has_main_web_app?: boolean;
57
+ /** True, if the bot allows users to create and delete topics in private chats. Returned only in getMe. */
58
+ allows_users_to_create_topics?: boolean;
56
59
  }
57
60
  export declare namespace Chat {
58
61
  /** Internal type representing private chats. */
@@ -155,6 +158,14 @@ declare namespace ChatFullInfo {
155
158
  message_auto_delete_time?: number;
156
159
  /** True, if messages from the chat can't be forwarded to other chats */
157
160
  has_protected_content?: true;
161
+ /** For private chats, the rating of the user if any */
162
+ rating?: UserRating;
163
+ /** For private chats, the rating of the user if any */
164
+ first_profile_audio?: Audio;
165
+ /** The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
166
+ unique_gift_colors?: UniqueGiftColors;
167
+ /** The number of Telegram Stars a general user have to pay to send a message to the chat */
168
+ paid_message_star_count?: number;
158
169
  }
159
170
  /** Internal type representing group chats returned from `getChat`. */
160
171
  interface GroupChat extends Chat.GroupChat {
@@ -198,6 +209,10 @@ declare namespace ChatFullInfo {
198
209
  has_visible_history?: true;
199
210
  /** True, if the bot can change the group sticker set */
200
211
  can_set_sticker_set?: true;
212
+ /** The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
213
+ unique_gift_colors?: UniqueGiftColors;
214
+ /** The number of Telegram Stars a general user have to pay to send a message to the chat */
215
+ paid_message_star_count?: number;
201
216
  }
202
217
  /** Internal type representing supergroup chats returned from `getChat`. */
203
218
  interface SupergroupChat extends Chat.SupergroupChat {
@@ -259,6 +274,10 @@ declare namespace ChatFullInfo {
259
274
  linked_chat_id?: number;
260
275
  /** For supergroups, the location to which the supergroup is connected */
261
276
  location?: ChatLocation;
277
+ /** The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
278
+ unique_gift_colors?: UniqueGiftColors;
279
+ /** The number of Telegram Stars a general user have to pay to send a message to the chat */
280
+ paid_message_star_count?: number;
262
281
  }
263
282
  /** Internal type representing channel chats returned from `getChat`. */
264
283
  interface ChannelChat extends Chat.ChannelChat {
@@ -294,6 +313,10 @@ declare namespace ChatFullInfo {
294
313
  has_protected_content?: true;
295
314
  /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. */
296
315
  linked_chat_id?: number;
316
+ /** The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
317
+ unique_gift_colors?: UniqueGiftColors;
318
+ /** The number of Telegram Stars a general user have to pay to send a message to the chat */
319
+ paid_message_star_count?: number;
297
320
  }
298
321
  }
299
322
  /** This object contains full information about a chat. */
@@ -335,6 +358,13 @@ export interface UserProfilePhotos {
335
358
  /** Requested profile pictures (in up to 4 sizes each) */
336
359
  photos: PhotoSize[][];
337
360
  }
361
+ /** This object represents the audios displayed on a user's profile. */
362
+ export interface UserProfileAudios {
363
+ /** Total number of profile pictures the target user has */
364
+ total_count: number;
365
+ /** Requested profile audios */
366
+ photos: Audio[];
367
+ }
338
368
  /** This object represents a chat photo. */
339
369
  export interface ChatPhoto {
340
370
  /** File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. */
@@ -624,6 +654,17 @@ export interface BusinessOpeningHours {
624
654
  /** List of time intervals describing business opening hours */
625
655
  opening_hours: BusinessOpeningHoursInterval[];
626
656
  }
657
+ /** This object describes the rating of a user based on their Telegram Star spendings. */
658
+ export interface UserRating {
659
+ /** Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern. */
660
+ level: number;
661
+ /** Numerical value of the user's rating; the higher the rating, the better */
662
+ rating: number;
663
+ /** The rating value required to get the current level */
664
+ current_level_rating: number;
665
+ /** The rating value required to get to the next level; omitted if the maximum level was reached */
666
+ next_level_rating?: number;
667
+ }
627
668
  /** Describes the position of a clickable area within a story. */
628
669
  export interface StoryAreaPosition {
629
670
  /** The abscissa of the area's center, as a percentage of the media width */
@@ -839,6 +880,8 @@ export interface ForumTopic {
839
880
  icon_color: number;
840
881
  /** Unique identifier of the custom emoji shown as the topic icon */
841
882
  icon_custom_emoji_id?: string;
883
+ /** True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot */
884
+ is_name_implicit?: boolean;
842
885
  }
843
886
  /** This object represents a bot command. */
844
887
  export interface BotCommand {
@@ -911,6 +954,16 @@ export interface ChatBoostRemoved {
911
954
  /** Source of the removed boost */
912
955
  source: ChatBoostSource;
913
956
  }
957
+ /** Describes a service message about the chat owner leaving the chat. */
958
+ export interface ChatOwnerLeft {
959
+ /** The user which will be the new owner of the chat if the previous owner does not return to the chat */
960
+ new_owner: User;
961
+ }
962
+ /** Describes a service message about an ownership change in the chat. */
963
+ export interface ChatOwnerChanged {
964
+ /** The new owner of the chat */
965
+ new_owner: User;
966
+ }
914
967
  /** This object represents a list of boosts added to a chat by a user. */
915
968
  export interface UserChatBoosts {
916
969
  /** The list of boosts added to the chat by the user */
@@ -954,6 +1007,15 @@ export interface File {
954
1007
  /** File path. Use `https://api.telegram.org/file/bot<token>/<file_path>` to get the file. */
955
1008
  file_path?: string;
956
1009
  }
1010
+ /** This object describes the background of a gift. */
1011
+ export interface GiftBackground {
1012
+ /** Center color of the background in RGB format */
1013
+ center_color: number;
1014
+ /** Edge color of the background in RGB format */
1015
+ edge_color: number;
1016
+ /** Text color of the background in RGB format */
1017
+ text_color: number;
1018
+ }
957
1019
  /** This object represents a gift that can be sent by the bot. */
958
1020
  export interface Gift {
959
1021
  /** Unique identifier of the gift */
@@ -964,10 +1026,22 @@ export interface Gift {
964
1026
  star_count: number;
965
1027
  /** The number of Telegram Stars that must be paid to upgrade the gift to a unique one */
966
1028
  upgrade_star_count?: number;
1029
+ /** True, if the gift can only be purchased by Telegram Premium subscribers */
1030
+ is_premium?: boolean;
1031
+ /** True, if the gift can be used (after being upgraded) to customize a user's appearance */
1032
+ has_colors?: boolean;
967
1033
  /** The total number of the gifts of this type that can be sent; for limited gifts only */
968
1034
  total_count?: number;
969
1035
  /** The number of remaining gifts of this type that can be sent; for limited gifts only */
970
1036
  remaining_count?: number;
1037
+ /** The total number of gifts of this type that can be sent by the bot; for limited gifts only */
1038
+ personal_total_count?: number;
1039
+ /** The number of remaining gifts of this type that can be sent by the bot; for limited gifts only */
1040
+ personal_remaining_count?: number;
1041
+ /** Background of the gift */
1042
+ background?: GiftBackground;
1043
+ /** The total number of different unique gifts that can be obtained by upgrading the gift */
1044
+ unique_gift_variant_count?: number;
971
1045
  /** Information about the chat that published the gift */
972
1046
  publisher_chat?: Chat;
973
1047
  }
@@ -984,6 +1058,8 @@ export interface UniqueGiftModel {
984
1058
  sticker: Sticker;
985
1059
  /** The number of unique gifts that receive this model for every 1000 gifts upgraded */
986
1060
  rarity_per_mille: number;
1061
+ /** Rarity of the model if it is a crafted model. Currently, can be “uncommon”, “rare”, “epic”, or “legendary”. */
1062
+ rarity?: 'uncommon' | 'rare' | 'epic' | 'legendary';
987
1063
  }
988
1064
  /** This object describes the symbol shown on the pattern of a unique gift. */
989
1065
  export interface UniqueGiftSymbol {
@@ -1014,8 +1090,25 @@ export interface UniqueGiftBackdrop {
1014
1090
  /** The number of unique gifts that receive this backdrop for every 1000 gifts upgraded */
1015
1091
  rarity_per_mille: number;
1016
1092
  }
1093
+ /** This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift */
1094
+ export interface UniqueGiftColors {
1095
+ /** Custom emoji identifier of the unique gift's model */
1096
+ model_custom_emoji_id: string;
1097
+ /** Custom emoji identifier of the unique gift's symbol */
1098
+ symbol_custom_emoji_id: string;
1099
+ /** Main color used in light themes; RGB format */
1100
+ light_theme_main_color: number;
1101
+ /** List of 1-3 additional colors used in light themes; RGB format */
1102
+ light_theme_other_colors: number[];
1103
+ /** Main color used in dark themes; RGB format */
1104
+ dark_theme_main_color: number;
1105
+ /** List of 1-3 additional colors used in dark themes; RGB format */
1106
+ namdark_theme_other_colorse: number[];
1107
+ }
1017
1108
  /** This object describes a unique gift that was upgraded from a regular gift. */
1018
1109
  export interface UniqueGift {
1110
+ /** Identifier of the regular gift from which the gift was upgraded */
1111
+ gift_id: string;
1019
1112
  /** Human-readable name of the regular gift from which this unique gift was upgraded */
1020
1113
  base_name: string;
1021
1114
  /** Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas */
@@ -1028,6 +1121,14 @@ export interface UniqueGift {
1028
1121
  symbol: UniqueGiftSymbol;
1029
1122
  /** Backdrop of the gift */
1030
1123
  backdrop: UniqueGiftBackdrop;
1124
+ /** True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers */
1125
+ is_premium?: boolean;
1126
+ /** True, if the gift was used to craft another gift and isn't available anymore */
1127
+ is_burned?: boolean;
1128
+ /** True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram */
1129
+ is_from_blockchain?: boolean;
1130
+ /** The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only */
1131
+ colors?: UniqueGiftColors;
1031
1132
  /** Information about the chat that published the gift */
1032
1133
  publisher_chat?: Chat;
1033
1134
  }
@@ -1063,6 +1164,10 @@ export interface OwnedGiftRegular {
1063
1164
  convert_star_count?: number;
1064
1165
  /** Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift */
1065
1166
  prepaid_upgrade_star_count?: number;
1167
+ /** True, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only */
1168
+ is_upgrade_separate?: boolean;
1169
+ /** Unique number reserved for this gift when upgraded. See the number field in UniqueGift */
1170
+ unique_gift_number?: number;
1066
1171
  }
1067
1172
  /** Describes a unique gift received and owned by a user or a chat. */
1068
1173
  export interface OwnedGiftUnique {
@@ -1104,6 +1209,8 @@ export interface AcceptedGiftTypes {
1104
1209
  unique_gifts: boolean;
1105
1210
  /** True, if a Telegram Premium subscription is accepted */
1106
1211
  premium_subscription: boolean;
1212
+ /** True, if transfers of unique gifts from channels are accepted */
1213
+ gifts_from_channels: boolean;
1107
1214
  }
1108
1215
  /** Describes an amount of Telegram Stars. */
1109
1216
  export interface StarAmount {
package/message.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Chat, DirectMessagesTopic, File, Gift, StarAmount, SuggestedPostInfo, SuggestedPostPrice, UniqueGift, User } from "./manage.js";
1
+ import type { Chat, DirectMessagesTopic, File, Gift, StarAmount, SuggestedPostInfo, SuggestedPostPrice, UniqueGift, User, ChatOwnerLeft, ChatOwnerChanged } from "./manage.js";
2
2
  import type { InlineKeyboardMarkup } from "./markup.js";
3
3
  import type { PassportData } from "./passport.js";
4
4
  import type { Invoice, RefundedPayment, SuccessfulPayment } from "./payment.js";
@@ -167,6 +167,14 @@ export declare namespace Message {
167
167
  /** A member was removed from the group, information about them (this member may be the bot itself) */
168
168
  left_chat_member: User;
169
169
  }
170
+ interface ChatOwnerLeftMessage extends ServiceMessage {
171
+ /** A member was removed from the group, information about them (this member may be the bot itself) */
172
+ chat_owner_left: ChatOwnerLeft;
173
+ }
174
+ interface ChatOwnerChangedMessage extends ServiceMessage {
175
+ /** A member was removed from the group, information about them (this member may be the bot itself) */
176
+ chat_owner_changed: ChatOwnerChanged;
177
+ }
170
178
  interface NewChatTitleMessage extends ServiceMessage {
171
179
  /** A chat title was changed to this value */
172
180
  new_chat_title: string;
@@ -235,6 +243,10 @@ export declare namespace Message {
235
243
  /** Service message: a unique gift was sent or received */
236
244
  unique_gift: UniqueGiftInfo;
237
245
  }
246
+ interface GiftUpgradeSentMessage extends ServiceMessage {
247
+ /** Service message: a unique gift was sent or received */
248
+ gift_upgrade_sent: GiftInfo;
249
+ }
238
250
  interface ConnectedWebsiteMessage extends ServiceMessage {
239
251
  /** The domain name of the website on which the user has logged in. More about Telegram Login » */
240
252
  connected_website: string;
@@ -831,6 +843,21 @@ export interface Story {
831
843
  /** Unique identifier for the story in the chat */
832
844
  id: number;
833
845
  }
846
+ /** This object represents a video file of a specific quality. */
847
+ export interface VideoQuality {
848
+ /** Identifier for this file, which can be used to download or reuse the file */
849
+ file_id: string;
850
+ /** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
851
+ file_unique_id: string;
852
+ /** Video width */
853
+ width: number;
854
+ /** Video height */
855
+ height: number;
856
+ /** Codec that was used to encode the video, for example, “h264”, “h265”, or “av01” */
857
+ codec: string;
858
+ /** File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. */
859
+ file_size: number;
860
+ }
834
861
  /** This object represents a video file. */
835
862
  export interface Video {
836
863
  /** Identifier for this file, which can be used to download or reuse the file */
@@ -849,6 +876,8 @@ export interface Video {
849
876
  cover?: PhotoSize[];
850
877
  /** Timestamp in seconds from which the video will play in the message */
851
878
  start_timestamp?: number;
879
+ /** List of available qualities of the video */
880
+ qualities?: VideoQuality[];
852
881
  /** Original filename as defined by the sender */
853
882
  file_name?: string;
854
883
  /** MIME type of the file as defined by the sender */
@@ -935,6 +964,8 @@ export interface ChecklistTask {
935
964
  text_entities?: MessageEntity[];
936
965
  /** User that completed the task; omitted if the task wasn't completed */
937
966
  completed_by_user?: User;
967
+ /** Chat that completed the task; omitted if the task wasn't completed by a chat */
968
+ completed_by_chat?: Chat;
938
969
  /** Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed */
939
970
  completion_date?: number;
940
971
  }
@@ -1113,13 +1144,6 @@ export interface Venue {
1113
1144
  /** Google Places type of the venue. (See supported types.) */
1114
1145
  google_place_type?: string;
1115
1146
  }
1116
- /** This object represents a message about a forwarded story in the chat. Currently holds no information. */
1117
- export interface Story {
1118
- /** Chat that posted the story */
1119
- chat: Chat;
1120
- /** Unique identifier for the story in the chat */
1121
- id: number;
1122
- }
1123
1147
  /** This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. */
1124
1148
  export interface ProximityAlertTriggered {
1125
1149
  /** User that triggered the alert */
@@ -1236,6 +1260,8 @@ export interface ForumTopicCreated {
1236
1260
  icon_color: number;
1237
1261
  /** Unique identifier of the custom emoji shown as the topic icon */
1238
1262
  icon_custom_emoji_id?: string;
1263
+ /** True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot */
1264
+ is_name_implicit?: boolean;
1239
1265
  }
1240
1266
  /** This object represents a service message about an edited forum topic. */
1241
1267
  export interface ForumTopicEdited {
@@ -1299,6 +1325,8 @@ export interface GiftInfo {
1299
1325
  convert_star_count?: number;
1300
1326
  /** Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift */
1301
1327
  prepaid_upgrade_star_count?: number;
1328
+ /** True, if the gift's upgrade was purchased after the gift was sent */
1329
+ is_upgrade_separate?: boolean;
1302
1330
  /** True, if the gift can be upgraded to a unique gift */
1303
1331
  can_be_upgraded?: boolean;
1304
1332
  /** Text of the message that was added to the gift */
@@ -1307,15 +1335,19 @@ export interface GiftInfo {
1307
1335
  entities?: MessageEntity[];
1308
1336
  /** True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them */
1309
1337
  is_private?: boolean;
1338
+ /** Unique number reserved for this gift when upgraded. See the number field in UniqueGift */
1339
+ unique_gift_number?: number;
1310
1340
  }
1311
1341
  /** Describes a service message about a unique gift that was sent or received. */
1312
1342
  export interface UniqueGiftInfo {
1313
1343
  /** Information about the gift */
1314
1344
  gift: UniqueGift;
1315
- /** Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, or “resale” for gifts bought from other users */
1316
- origin: "upgrade" | "transfer" | "resale";
1317
- /** For gifts bought from other users, the price paid for the gift */
1318
- last_resale_star_count?: number;
1345
+ /** Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers */
1346
+ origin: "upgrade" | "transfer" | "resale" | 'gifted_upgrade' | 'offer';
1347
+ /** For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins. */
1348
+ last_resale_currency?: 'XTR' | 'TON';
1349
+ /** For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins */
1350
+ last_resale_amount?: number;
1319
1351
  /** Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts */
1320
1352
  owned_gift_id?: string;
1321
1353
  /** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
package/methods.d.ts CHANGED
@@ -6,6 +6,7 @@ import type { PassportElementError } from "./passport.js";
6
6
  import type { LabeledPrice, ShippingOption, StarTransactions } from "./payment.js";
7
7
  import type { BotCommandScope, BotDescription, BotName, BotShortDescription, MenuButton } from "./settings.js";
8
8
  import type { Update } from "./update.js";
9
+ import { UserProfileAudios } from './manage';
9
10
  /** Extracts the parameters of a given method name */
10
11
  type Params<F, M extends keyof ApiMethods<F>> = Parameters<ApiMethods<F>[M]>;
11
12
  /** Utility type providing the argument type for the given method name or `{}` if the method does not take any parameters */
@@ -82,7 +83,7 @@ export type ApiMethods<F> = {
82
83
  business_connection_id?: string;
83
84
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
84
85
  chat_id: number | string;
85
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
86
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
86
87
  message_thread_id?: number;
87
88
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
88
89
  direct_messages_topic_id?: number;
@@ -113,7 +114,7 @@ export type ApiMethods<F> = {
113
114
  forwardMessage(args: {
114
115
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
115
116
  chat_id: number | string;
116
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
117
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
117
118
  message_thread_id?: number;
118
119
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
119
120
  direct_messages_topic_id?: number;
@@ -125,6 +126,8 @@ export type ApiMethods<F> = {
125
126
  disable_notification?: boolean;
126
127
  /** Protects the contents of the forwarded message from forwarding and saving */
127
128
  protect_content?: boolean;
129
+ /** Unique identifier of the message effect to be added to the message; only available when forwarding to private chats */
130
+ message_effect_id?: string;
128
131
  /** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
129
132
  suggested_post_parameters?: SuggestedPostParameters;
130
133
  /** Message identifier in the chat specified in from_chat_id */
@@ -134,7 +137,7 @@ export type ApiMethods<F> = {
134
137
  forwardMessages(args: {
135
138
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
136
139
  chat_id: number | string;
137
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
140
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
138
141
  message_thread_id?: number;
139
142
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
140
143
  direct_messages_topic_id?: number;
@@ -151,7 +154,7 @@ export type ApiMethods<F> = {
151
154
  copyMessage(args: {
152
155
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
153
156
  chat_id: number | string;
154
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
157
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
155
158
  message_thread_id?: number;
156
159
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
157
160
  direct_messages_topic_id?: number;
@@ -175,6 +178,8 @@ export type ApiMethods<F> = {
175
178
  protect_content?: boolean;
176
179
  /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
177
180
  allow_paid_broadcast?: boolean;
181
+ /** Unique identifier of the message effect to be added to the message; only available when forwarding to private chats */
182
+ message_effect_id?: string;
178
183
  /** An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */
179
184
  suggested_post_parameters?: SuggestedPostParameters;
180
185
  /** Description of the message to reply to */
@@ -186,7 +191,7 @@ export type ApiMethods<F> = {
186
191
  copyMessages(args: {
187
192
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
188
193
  chat_id: number | string;
189
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
194
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
190
195
  message_thread_id?: number;
191
196
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
192
197
  direct_messages_topic_id?: number;
@@ -207,7 +212,7 @@ export type ApiMethods<F> = {
207
212
  business_connection_id?: string;
208
213
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
209
214
  chat_id: number | string;
210
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
215
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
211
216
  message_thread_id?: number;
212
217
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
213
218
  direct_messages_topic_id?: number;
@@ -244,7 +249,7 @@ export type ApiMethods<F> = {
244
249
  business_connection_id?: string;
245
250
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
246
251
  chat_id: number | string;
247
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
252
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
248
253
  message_thread_id?: number;
249
254
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
250
255
  direct_messages_topic_id?: number;
@@ -285,7 +290,7 @@ export type ApiMethods<F> = {
285
290
  business_connection_id?: string;
286
291
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
287
292
  chat_id: number | string;
288
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
293
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
289
294
  message_thread_id?: number;
290
295
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
291
296
  direct_messages_topic_id?: number;
@@ -322,7 +327,7 @@ export type ApiMethods<F> = {
322
327
  business_connection_id?: string;
323
328
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
324
329
  chat_id: number | string;
325
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
330
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
326
331
  message_thread_id?: number;
327
332
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
328
333
  direct_messages_topic_id?: number;
@@ -373,7 +378,7 @@ export type ApiMethods<F> = {
373
378
  business_connection_id?: string;
374
379
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
375
380
  chat_id: number | string;
376
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
381
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
377
382
  message_thread_id?: number;
378
383
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
379
384
  direct_messages_topic_id?: number;
@@ -418,7 +423,7 @@ export type ApiMethods<F> = {
418
423
  business_connection_id?: string;
419
424
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
420
425
  chat_id: number | string;
421
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
426
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
422
427
  message_thread_id?: number;
423
428
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
424
429
  direct_messages_topic_id?: number;
@@ -454,7 +459,7 @@ export type ApiMethods<F> = {
454
459
  business_connection_id?: string;
455
460
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
456
461
  chat_id: number | string;
457
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
462
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
458
463
  message_thread_id?: number;
459
464
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
460
465
  direct_messages_topic_id?: number;
@@ -487,11 +492,11 @@ export type ApiMethods<F> = {
487
492
  business_connection_id?: string;
488
493
  /** 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. */
489
494
  chat_id: number | string;
490
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
495
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
491
496
  message_thread_id?: number;
492
497
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
493
498
  direct_messages_topic_id?: number;
494
- /** The number of Telegram Stars that must be paid to buy access to the media; 1-10000 */
499
+ /** The number of Telegram Stars that must be paid to buy access to the media; 1-25000 */
495
500
  star_count: number;
496
501
  /** An array describing the media to be sent; up to 10 items */
497
502
  media: InputPaidMedia<F>[];
@@ -524,7 +529,7 @@ export type ApiMethods<F> = {
524
529
  business_connection_id?: string;
525
530
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
526
531
  chat_id: number | string;
527
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
532
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
528
533
  message_thread_id?: number;
529
534
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
530
535
  direct_messages_topic_id?: number;
@@ -547,7 +552,7 @@ export type ApiMethods<F> = {
547
552
  business_connection_id?: string;
548
553
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
549
554
  chat_id: number | string;
550
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
555
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
551
556
  message_thread_id?: number;
552
557
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
553
558
  direct_messages_topic_id?: number;
@@ -584,7 +589,7 @@ export type ApiMethods<F> = {
584
589
  business_connection_id?: string;
585
590
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
586
591
  chat_id: number | string;
587
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
592
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
588
593
  message_thread_id?: number;
589
594
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
590
595
  direct_messages_topic_id?: number;
@@ -625,7 +630,7 @@ export type ApiMethods<F> = {
625
630
  business_connection_id?: string;
626
631
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
627
632
  chat_id: number | string;
628
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
633
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
629
634
  message_thread_id?: number;
630
635
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
631
636
  direct_messages_topic_id?: number;
@@ -658,7 +663,7 @@ export type ApiMethods<F> = {
658
663
  business_connection_id?: string;
659
664
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`). Polls can't be sent to channel direct messages chats. */
660
665
  chat_id: number | string;
661
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
666
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
662
667
  message_thread_id?: number;
663
668
  /** Poll question, 1-300 characters */
664
669
  question: string;
@@ -726,7 +731,7 @@ export type ApiMethods<F> = {
726
731
  business_connection_id?: string;
727
732
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
728
733
  chat_id: number | string;
729
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
734
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
730
735
  message_thread_id?: number;
731
736
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
732
737
  direct_messages_topic_id?: number;
@@ -747,6 +752,21 @@ export type ApiMethods<F> = {
747
752
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user */
748
753
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
749
754
  }): Message.DiceMessage & Message.BusinessSentMessage;
755
+ /** Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success. */
756
+ sendMessageDraft(args: {
757
+ /** Unique identifier for the target private chat */
758
+ chat_id: number | string;
759
+ /** Unique identifier for the target message thread */
760
+ message_thread_id?: number;
761
+ /** Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated */
762
+ draft_id: number | string;
763
+ /** Text of the message to be sent, 1-4096 characters after entities parsing */
764
+ text: string;
765
+ /** Mode for parsing entities in the message text. See formatting options for more details */
766
+ parse_mode?: ParseMode;
767
+ /** A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode */
768
+ entities?: MessageEntity[];
769
+ }): true;
750
770
  /** Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
751
771
 
752
772
  Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of "Retrieving image, please wait...", the bot may use sendChatAction with action = upload_photo. The user will see a "sending photo" status for the bot.
@@ -782,6 +802,15 @@ export type ApiMethods<F> = {
782
802
  /** Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. */
783
803
  limit?: number;
784
804
  }): UserProfilePhotos;
805
+ /** Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object. */
806
+ getUserProfileAudios(args: {
807
+ /** Unique identifier of the target user */
808
+ user_id: number;
809
+ /** Sequential number of the first audio to be returned. By default, all audios are returned. */
810
+ offset?: number;
811
+ /** Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100. */
812
+ limit?: number;
813
+ }): UserProfileAudios;
785
814
  /** Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success. */
786
815
  setUserEmojiStatus(args: {
787
816
  /** Unique identifier of the target user */
@@ -948,7 +977,7 @@ export type ApiMethods<F> = {
948
977
  name?: string;
949
978
  /** The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). */
950
979
  subscription_period: 2592000;
951
- /** The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000 */
980
+ /** The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-25000 */
952
981
  subscription_price: number;
953
982
  }): ChatInviteLink;
954
983
  /** 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. */
@@ -1076,7 +1105,7 @@ export type ApiMethods<F> = {
1076
1105
  }): true;
1077
1106
  /** Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of Sticker objects. */
1078
1107
  getForumTopicIconStickers(): Sticker[];
1079
- /** Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object. */
1108
+ /** Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a ForumTopic object. */
1080
1109
  createForumTopic(args: {
1081
1110
  /** Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`) */
1082
1111
  chat_id: number | string;
@@ -1245,6 +1274,13 @@ export type ApiMethods<F> = {
1245
1274
  /** A two-letter ISO 639-1 language code or an empty string */
1246
1275
  language_code?: string;
1247
1276
  }): BotShortDescription;
1277
+ /** Changes the profile photo of the bot. Returns True on success. */
1278
+ setMyProfilePhoto(args: {
1279
+ /** The new profile photo to set */
1280
+ photo: InputProfilePhoto<F>;
1281
+ }): true;
1282
+ /** Removes the profile photo of the bot. Requires no parameters. Returns True on success. */
1283
+ removeMyProfilePhoto(): true;
1248
1284
  /** Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success. */
1249
1285
  setChatMenuButton(args: {
1250
1286
  /** Unique identifier for the target private chat. If not specified, default bot's menu button will be changed */
@@ -1381,7 +1417,7 @@ export type ApiMethods<F> = {
1381
1417
  transferBusinessAccountStars(args: {
1382
1418
  /** Unique identifier of the business connection */
1383
1419
  business_connection_id: string;
1384
- /** Number of Telegram Stars to transfer; 1-10000 */
1420
+ /** Number of Telegram Stars to transfer; 1-25000 */
1385
1421
  star_count: number;
1386
1422
  }): true;
1387
1423
  /** Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success. */
@@ -1394,8 +1430,58 @@ export type ApiMethods<F> = {
1394
1430
  exclude_saved?: boolean;
1395
1431
  /** Pass True to exclude gifts that can be purchased an unlimited number of times */
1396
1432
  exclude_unlimited?: boolean;
1397
- /** Pass True to exclude gifts that can be purchased a limited number of times */
1398
- exclude_limited?: boolean;
1433
+ /** Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique */
1434
+ exclude_limited_upgradable?: boolean;
1435
+ /** Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique */
1436
+ exclude_limited_non_upgradable?: boolean;
1437
+ /** Pass True to exclude unique gifts */
1438
+ exclude_unique?: boolean;
1439
+ /** Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram */
1440
+ exclude_from_blockchain?: boolean;
1441
+ /** Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. */
1442
+ sort_by_price?: boolean;
1443
+ /** Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results */
1444
+ offset?: string;
1445
+ /** The maximum number of gifts to be returned; 1-100. Defaults to 100 */
1446
+ limit?: number;
1447
+ }): OwnedGifts;
1448
+ /** Returns the gifts owned and hosted by a user. Returns OwnedGifts on success. */
1449
+ getUserGifts(args: {
1450
+ /** Unique identifier of the user */
1451
+ user_id: number;
1452
+ /** Pass True to exclude gifts that can be purchased an unlimited number of times */
1453
+ exclude_unlimited?: boolean;
1454
+ /** Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique */
1455
+ exclude_limited_upgradable?: boolean;
1456
+ /** Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique */
1457
+ exclude_limited_non_upgradable?: boolean;
1458
+ /** Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram */
1459
+ exclude_from_blockchain?: boolean;
1460
+ /** Pass True to exclude unique gifts */
1461
+ exclude_unique?: boolean;
1462
+ /** Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. */
1463
+ sort_by_price?: boolean;
1464
+ /** Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results */
1465
+ offset?: string;
1466
+ /** The maximum number of gifts to be returned; 1-100. Defaults to 100 */
1467
+ limit?: number;
1468
+ }): OwnedGifts;
1469
+ /** Returns the gifts owned by a chat. Returns OwnedGifts on success. */
1470
+ getChatGifts(args: {
1471
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1472
+ chat_id: number | string;
1473
+ /** Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel */
1474
+ exclude_unsaved?: boolean;
1475
+ /** Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel. */
1476
+ exclude_saved?: boolean;
1477
+ /** Pass True to exclude gifts that can be purchased an unlimited number of times */
1478
+ exclude_unlimited?: boolean;
1479
+ /** Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique */
1480
+ exclude_limited_upgradable?: boolean;
1481
+ /** Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique */
1482
+ exclude_limited_non_upgradable?: boolean;
1483
+ /** Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram */
1484
+ exclude_from_blockchain?: boolean;
1399
1485
  /** Pass True to exclude unique gifts */
1400
1486
  exclude_unique?: boolean;
1401
1487
  /** Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. */
@@ -1455,6 +1541,21 @@ export type ApiMethods<F> = {
1455
1541
  /** Pass True if the content of the story must be protected from forwarding and screenshotting */
1456
1542
  protect_content?: boolean;
1457
1543
  }): Story;
1544
+ /** Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success */
1545
+ repostStory(args: {
1546
+ /** Unique identifier of the business connection */
1547
+ business_connection_id: string;
1548
+ /** Unique identifier of the chat which posted the story that should be reposted */
1549
+ from_chat_id: number;
1550
+ /** Unique identifier of the story that should be reposted */
1551
+ from_story_id: number;
1552
+ /** Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 */
1553
+ active_period: 21600 | 43200 | 86400 | 172800;
1554
+ /** Pass True to keep the story accessible after it expires */
1555
+ post_to_chat_page?: boolean;
1556
+ /** Pass True if the content of the story must be protected from forwarding and screenshotting */
1557
+ protect_content?: boolean;
1558
+ }): Story;
1458
1559
  /** Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success. */
1459
1560
  editStory(args: {
1460
1561
  /** Unique identifier of the business connection */
@@ -1664,7 +1765,7 @@ export type ApiMethods<F> = {
1664
1765
  business_connection_id?: string;
1665
1766
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
1666
1767
  chat_id: number | string;
1667
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1768
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
1668
1769
  message_thread_id?: number;
1669
1770
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
1670
1771
  direct_messages_topic_id?: number;
@@ -1848,7 +1949,7 @@ export type ApiMethods<F> = {
1848
1949
  sendInvoice(args: {
1849
1950
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
1850
1951
  chat_id: number | string;
1851
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1952
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
1852
1953
  message_thread_id?: number;
1853
1954
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
1854
1955
  direct_messages_topic_id?: number;
@@ -2016,7 +2117,7 @@ export type ApiMethods<F> = {
2016
2117
  business_connection_id?: string;
2017
2118
  /** Unique identifier for the target chat */
2018
2119
  chat_id: number;
2019
- /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
2120
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups or private chats with topics */
2020
2121
  message_thread_id?: number;
2021
2122
  /** Short name of the game, serves as the unique identifier for the game. Set up your games via BotFather. */
2022
2123
  game_short_name: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tgify/types",
3
3
  "private": false,
4
- "version": "9.2.4",
4
+ "version": "9.4.0",
5
5
  "description": "Type declarations for the Telegram API",
6
6
  "main": "index.js",
7
7
  "repository": {