@grammyjs/types 3.8.1 → 3.10.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 +8 -0
- package/markup.d.ts +1 -1
- package/message.d.ts +44 -1
- package/methods.d.ts +99 -24
- package/package.json +1 -1
- package/payment.d.ts +76 -0
- package/settings.d.ts +1 -1
package/manage.d.ts
CHANGED
|
@@ -214,6 +214,8 @@ export declare namespace ChatFullInfo {
|
|
|
214
214
|
linked_chat_id?: undefined;
|
|
215
215
|
/** For supergroups, the location to which the supergroup is connected */
|
|
216
216
|
location?: undefined;
|
|
217
|
+
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
218
|
+
can_send_paid_media?: undefined;
|
|
217
219
|
}
|
|
218
220
|
/** Internal type for group chats */
|
|
219
221
|
interface GroupChat {
|
|
@@ -303,6 +305,8 @@ export declare namespace ChatFullInfo {
|
|
|
303
305
|
linked_chat_id?: undefined;
|
|
304
306
|
/** For supergroups, the location to which the supergroup is connected */
|
|
305
307
|
location?: undefined;
|
|
308
|
+
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
309
|
+
can_send_paid_media?: undefined;
|
|
306
310
|
}
|
|
307
311
|
/** Internal type for supergroup chats */
|
|
308
312
|
interface SupergroupChat {
|
|
@@ -392,6 +396,8 @@ export declare namespace ChatFullInfo {
|
|
|
392
396
|
linked_chat_id?: number;
|
|
393
397
|
/** For supergroups, the location to which the supergroup is connected */
|
|
394
398
|
location?: ChatLocation;
|
|
399
|
+
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
400
|
+
can_send_paid_media?: undefined;
|
|
395
401
|
}
|
|
396
402
|
/** Internal type for channel chats */
|
|
397
403
|
interface ChannelChat {
|
|
@@ -481,6 +487,8 @@ export declare namespace ChatFullInfo {
|
|
|
481
487
|
linked_chat_id?: number;
|
|
482
488
|
/** For supergroups, the location to which the supergroup is connected */
|
|
483
489
|
location?: undefined;
|
|
490
|
+
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
491
|
+
can_send_paid_media?: true;
|
|
484
492
|
}
|
|
485
493
|
}
|
|
486
494
|
/** This object contains full information about a chat. */
|
package/markup.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare namespace InlineKeyboardButton {
|
|
|
15
15
|
url: string;
|
|
16
16
|
}
|
|
17
17
|
interface CallbackButton extends AbstractInlineKeyboardButton {
|
|
18
|
-
/** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
|
|
18
|
+
/** Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes */
|
|
19
19
|
callback_data: string;
|
|
20
20
|
}
|
|
21
21
|
interface WebAppButton extends AbstractInlineKeyboardButton {
|
package/message.d.ts
CHANGED
|
@@ -84,8 +84,9 @@ export declare namespace Message {
|
|
|
84
84
|
type DiceMessage = CommonMessage & MsgWith<"dice">;
|
|
85
85
|
type GameMessage = CommonMessage & MsgWith<"game">;
|
|
86
86
|
type PollMessage = CommonMessage & MsgWith<"poll">;
|
|
87
|
-
type LocationMessage = CommonMessage & MsgWith<"location">;
|
|
88
87
|
type VenueMessage = LocationMessage & MsgWith<"venue">;
|
|
88
|
+
type LocationMessage = CommonMessage & MsgWith<"location">;
|
|
89
|
+
type PaidMediaMessage = CommonMessage & MsgWith<"paid_media">;
|
|
89
90
|
type NewChatMembersMessage = ServiceMessage & MsgWith<"new_chat_members">;
|
|
90
91
|
type LeftChatMemberMessage = ServiceMessage & MsgWith<"left_chat_member">;
|
|
91
92
|
type NewChatTitleMessage = ServiceMessage & MsgWith<"new_chat_title">;
|
|
@@ -162,6 +163,8 @@ export interface Message extends Message.MediaMessage {
|
|
|
162
163
|
venue?: Venue;
|
|
163
164
|
/** Message is a shared location, information about the location */
|
|
164
165
|
location?: Location;
|
|
166
|
+
/** Message contains paid media; information about the paid media */
|
|
167
|
+
paid_media?: PaidMediaInfo;
|
|
165
168
|
/** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
|
|
166
169
|
new_chat_members?: User[];
|
|
167
170
|
/** A member was removed from the group, information about them (this member may be the bot itself) */
|
|
@@ -462,6 +465,8 @@ export interface ExternalReplyInfo {
|
|
|
462
465
|
invoice?: Invoice;
|
|
463
466
|
/** Message is a shared location, information about the location */
|
|
464
467
|
location?: Location;
|
|
468
|
+
/** Message contains paid media; information about the paid media */
|
|
469
|
+
paid_media?: PaidMediaInfo;
|
|
465
470
|
/** Message is a native poll, information about the poll */
|
|
466
471
|
poll?: Poll;
|
|
467
472
|
/** Message is a venue, information about the venue */
|
|
@@ -754,6 +759,44 @@ export interface Location {
|
|
|
754
759
|
/** The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */
|
|
755
760
|
proximity_alert_radius?: number;
|
|
756
761
|
}
|
|
762
|
+
/** Describes the paid media added to a message. */
|
|
763
|
+
export interface PaidMediaInfo {
|
|
764
|
+
/** The number of Telegram Stars that must be paid to buy access to the media */
|
|
765
|
+
star_count: number;
|
|
766
|
+
/** Information about the paid media */
|
|
767
|
+
paid_media: PaidMedia[];
|
|
768
|
+
}
|
|
769
|
+
/** This object describes paid media. Currently, it can be one of
|
|
770
|
+
|
|
771
|
+
- PaidMediaPreview
|
|
772
|
+
- PaidMediaPhoto
|
|
773
|
+
- PaidMediaVideo */
|
|
774
|
+
export type PaidMedia = PaidMediaPreview | PaidMediaPhoto | PaidMediaVideo;
|
|
775
|
+
/** The paid media isn't available before the payment. */
|
|
776
|
+
export interface PaidMediaPreview {
|
|
777
|
+
/** Type of the paid media, always “preview” */
|
|
778
|
+
type: "preview";
|
|
779
|
+
/** Media width as defined by the sender */
|
|
780
|
+
width?: number;
|
|
781
|
+
/** Media height as defined by the sender */
|
|
782
|
+
height?: number;
|
|
783
|
+
/** Duration of the media in seconds as defined by the sender */
|
|
784
|
+
duration?: number;
|
|
785
|
+
}
|
|
786
|
+
/** The paid media is a photo. */
|
|
787
|
+
export interface PaidMediaPhoto {
|
|
788
|
+
/** Type of the paid media, always “photo” */
|
|
789
|
+
type: "photo";
|
|
790
|
+
/** The photo */
|
|
791
|
+
photo: PhotoSize[];
|
|
792
|
+
}
|
|
793
|
+
/** The paid media is a video. */
|
|
794
|
+
export interface PaidMediaVideo {
|
|
795
|
+
/** Type of the paid media, always “video” */
|
|
796
|
+
type: "video";
|
|
797
|
+
/** The video */
|
|
798
|
+
video: Video;
|
|
799
|
+
}
|
|
757
800
|
/** This object represents a venue. */
|
|
758
801
|
export interface Venue {
|
|
759
802
|
/** Venue location. Can't be a live location */
|
package/methods.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { ChatFullInfo } from "./manage.js";
|
|
|
4
4
|
import type { ForceReply, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "./markup.js";
|
|
5
5
|
import type { File, GameHighScore, InputPollOption, LinkPreviewOptions, MaskPosition, Message, MessageEntity, MessageId, ParseMode, Poll, ReactionType, ReplyParameters, SentWebAppMessage, Sticker, StickerSet } from "./message.js";
|
|
6
6
|
import type { PassportElementError } from "./passport.js";
|
|
7
|
-
import type { LabeledPrice, ShippingOption } from "./payment.js";
|
|
7
|
+
import type { LabeledPrice, ShippingOption, StarTransactions } from "./payment.js";
|
|
8
8
|
import type { BotCommandScope, BotDescription, BotName, BotShortDescription, MenuButton } from "./settings.js";
|
|
9
9
|
import type { Update } from "./update.js";
|
|
10
10
|
import type { LanguageCode } from "./langs.js";
|
|
@@ -94,7 +94,7 @@ export type ApiMethods<F> = {
|
|
|
94
94
|
disable_notification?: boolean;
|
|
95
95
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
96
96
|
protect_content?: boolean;
|
|
97
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
97
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
98
98
|
message_effect_id?: string;
|
|
99
99
|
/** Description of the message to reply to */
|
|
100
100
|
reply_parameters?: ReplyParameters;
|
|
@@ -133,7 +133,7 @@ export type ApiMethods<F> = {
|
|
|
133
133
|
/** Protects the contents of the forwarded messages from forwarding and saving */
|
|
134
134
|
protect_content?: boolean;
|
|
135
135
|
}): MessageId[];
|
|
136
|
-
/** Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. */
|
|
136
|
+
/** Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. */
|
|
137
137
|
copyMessage(args: {
|
|
138
138
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
139
139
|
chat_id: number | string;
|
|
@@ -162,7 +162,7 @@ export type ApiMethods<F> = {
|
|
|
162
162
|
/** @deprecated Use `reply_parameters` instead. */
|
|
163
163
|
reply_to_message_id?: number;
|
|
164
164
|
}): MessageId;
|
|
165
|
-
/** Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned. */
|
|
165
|
+
/** Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned. */
|
|
166
166
|
copyMessages(args: {
|
|
167
167
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
168
168
|
chat_id: number | string;
|
|
@@ -203,7 +203,7 @@ export type ApiMethods<F> = {
|
|
|
203
203
|
disable_notification?: boolean;
|
|
204
204
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
205
205
|
protect_content?: boolean;
|
|
206
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
206
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
207
207
|
message_effect_id?: string;
|
|
208
208
|
/** Description of the message to reply to */
|
|
209
209
|
reply_parameters?: ReplyParameters;
|
|
@@ -242,7 +242,7 @@ export type ApiMethods<F> = {
|
|
|
242
242
|
disable_notification?: boolean;
|
|
243
243
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
244
244
|
protect_content?: boolean;
|
|
245
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
245
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
246
246
|
message_effect_id?: string;
|
|
247
247
|
/** Description of the message to reply to */
|
|
248
248
|
reply_parameters?: ReplyParameters;
|
|
@@ -275,7 +275,7 @@ export type ApiMethods<F> = {
|
|
|
275
275
|
disable_notification?: boolean;
|
|
276
276
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
277
277
|
protect_content?: boolean;
|
|
278
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
278
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
279
279
|
message_effect_id?: string;
|
|
280
280
|
/** Description of the message to reply to */
|
|
281
281
|
reply_parameters?: ReplyParameters;
|
|
@@ -318,7 +318,7 @@ export type ApiMethods<F> = {
|
|
|
318
318
|
disable_notification?: boolean;
|
|
319
319
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
320
320
|
protect_content?: boolean;
|
|
321
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
321
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
322
322
|
message_effect_id?: string;
|
|
323
323
|
/** Description of the message to reply to */
|
|
324
324
|
reply_parameters?: ReplyParameters;
|
|
@@ -359,7 +359,7 @@ export type ApiMethods<F> = {
|
|
|
359
359
|
disable_notification?: boolean;
|
|
360
360
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
361
361
|
protect_content?: boolean;
|
|
362
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
362
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
363
363
|
message_effect_id?: string;
|
|
364
364
|
/** Description of the message to reply to */
|
|
365
365
|
reply_parameters?: ReplyParameters;
|
|
@@ -390,7 +390,7 @@ export type ApiMethods<F> = {
|
|
|
390
390
|
disable_notification?: boolean;
|
|
391
391
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
392
392
|
protect_content?: boolean;
|
|
393
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
393
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
394
394
|
message_effect_id?: string;
|
|
395
395
|
/** Description of the message to reply to */
|
|
396
396
|
reply_parameters?: ReplyParameters;
|
|
@@ -420,7 +420,7 @@ export type ApiMethods<F> = {
|
|
|
420
420
|
disable_notification?: boolean;
|
|
421
421
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
422
422
|
protect_content?: boolean;
|
|
423
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
423
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
424
424
|
message_effect_id?: string;
|
|
425
425
|
/** Description of the message to reply to */
|
|
426
426
|
reply_parameters?: ReplyParameters;
|
|
@@ -443,7 +443,7 @@ export type ApiMethods<F> = {
|
|
|
443
443
|
disable_notification?: boolean;
|
|
444
444
|
/** Protects the contents of the sent messages from forwarding and saving */
|
|
445
445
|
protect_content?: boolean;
|
|
446
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
446
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
447
447
|
message_effect_id?: string;
|
|
448
448
|
/** Description of the message to reply to */
|
|
449
449
|
reply_parameters?: ReplyParameters;
|
|
@@ -474,7 +474,7 @@ export type ApiMethods<F> = {
|
|
|
474
474
|
disable_notification?: boolean;
|
|
475
475
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
476
476
|
protect_content?: boolean;
|
|
477
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
477
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
478
478
|
message_effect_id?: string;
|
|
479
479
|
/** Description of the message to reply to */
|
|
480
480
|
reply_parameters?: ReplyParameters;
|
|
@@ -485,6 +485,8 @@ export type ApiMethods<F> = {
|
|
|
485
485
|
}): Message.LocationMessage;
|
|
486
486
|
/** Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
487
487
|
editMessageLiveLocation(args: {
|
|
488
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
489
|
+
business_connection_id?: string;
|
|
488
490
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
489
491
|
chat_id?: number | string;
|
|
490
492
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -508,6 +510,8 @@ export type ApiMethods<F> = {
|
|
|
508
510
|
}): (Update.Edited & Message.LocationMessage) | true;
|
|
509
511
|
/** Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
510
512
|
stopMessageLiveLocation(args: {
|
|
513
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
514
|
+
business_connection_id?: string;
|
|
511
515
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
512
516
|
chat_id?: number | string;
|
|
513
517
|
/** Required if inline_message_id is not specified. Identifier of the message with live location to stop */
|
|
@@ -517,6 +521,31 @@ export type ApiMethods<F> = {
|
|
|
517
521
|
/** An object for a new inline keyboard. */
|
|
518
522
|
reply_markup?: InlineKeyboardMarkup;
|
|
519
523
|
}): (Update.Edited & Message.LocationMessage) | true;
|
|
524
|
+
/** Use this method to send paid media to channel chats. On success, the sent Message is returned. */
|
|
525
|
+
sendPaidMedia(args: {
|
|
526
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
527
|
+
chat_id: number | string;
|
|
528
|
+
/** The number of Telegram Stars that must be paid to buy access to the media */
|
|
529
|
+
star_count: number;
|
|
530
|
+
/** An array describing the media to be sent; up to 10 items */
|
|
531
|
+
media: InputPaidMedia<F>[];
|
|
532
|
+
/** Media caption, 0-1024 characters after entities parsing */
|
|
533
|
+
caption?: string;
|
|
534
|
+
/** Mode for parsing entities in the media caption. See formatting options for more details. */
|
|
535
|
+
parse_mode?: string;
|
|
536
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
537
|
+
caption_entities?: MessageEntity[];
|
|
538
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
539
|
+
show_caption_above_media?: boolean;
|
|
540
|
+
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
541
|
+
disable_notification?: boolean;
|
|
542
|
+
/** Protects the contents of the sent message from forwarding and saving */
|
|
543
|
+
protect_content?: boolean;
|
|
544
|
+
/** Description of the message to reply to */
|
|
545
|
+
reply_parameters?: ReplyParameters;
|
|
546
|
+
/** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user */
|
|
547
|
+
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
548
|
+
}): Message.PaidMediaMessage;
|
|
520
549
|
/** Use this method to send information about a venue. On success, the sent Message is returned. */
|
|
521
550
|
sendVenue(args: {
|
|
522
551
|
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
@@ -545,7 +574,7 @@ export type ApiMethods<F> = {
|
|
|
545
574
|
disable_notification?: boolean;
|
|
546
575
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
547
576
|
protect_content?: boolean;
|
|
548
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
577
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
549
578
|
message_effect_id?: string;
|
|
550
579
|
/** Description of the message to reply to */
|
|
551
580
|
reply_parameters?: ReplyParameters;
|
|
@@ -574,7 +603,7 @@ export type ApiMethods<F> = {
|
|
|
574
603
|
disable_notification?: boolean;
|
|
575
604
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
576
605
|
protect_content?: boolean;
|
|
577
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
606
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
578
607
|
message_effect_id?: string;
|
|
579
608
|
/** Description of the message to reply to */
|
|
580
609
|
reply_parameters?: ReplyParameters;
|
|
@@ -623,7 +652,7 @@ export type ApiMethods<F> = {
|
|
|
623
652
|
disable_notification?: boolean;
|
|
624
653
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
625
654
|
protect_content?: boolean;
|
|
626
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
655
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
627
656
|
message_effect_id?: string;
|
|
628
657
|
/** Description of the message to reply to */
|
|
629
658
|
reply_parameters?: ReplyParameters;
|
|
@@ -646,7 +675,7 @@ export type ApiMethods<F> = {
|
|
|
646
675
|
disable_notification?: boolean;
|
|
647
676
|
/** Protects the contents of the sent message from forwarding */
|
|
648
677
|
protect_content?: boolean;
|
|
649
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
678
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
650
679
|
message_effect_id?: string;
|
|
651
680
|
/** Description of the message to reply to */
|
|
652
681
|
reply_parameters?: ReplyParameters;
|
|
@@ -1143,8 +1172,10 @@ export type ApiMethods<F> = {
|
|
|
1143
1172
|
/** Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned. */
|
|
1144
1173
|
for_channels?: boolean;
|
|
1145
1174
|
}): ChatAdministratorRights;
|
|
1146
|
-
/** Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
1175
|
+
/** Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1147
1176
|
editMessageText(args: {
|
|
1177
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1178
|
+
business_connection_id?: string;
|
|
1148
1179
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1149
1180
|
chat_id?: number | string;
|
|
1150
1181
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -1162,8 +1193,10 @@ export type ApiMethods<F> = {
|
|
|
1162
1193
|
/** An object for an inline keyboard. */
|
|
1163
1194
|
reply_markup?: InlineKeyboardMarkup;
|
|
1164
1195
|
}): (Update.Edited & Message.TextMessage) | true;
|
|
1165
|
-
/** Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
1196
|
+
/** Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1166
1197
|
editMessageCaption(args: {
|
|
1198
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1199
|
+
business_connection_id?: string;
|
|
1167
1200
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1168
1201
|
chat_id?: number | string;
|
|
1169
1202
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -1181,8 +1214,10 @@ export type ApiMethods<F> = {
|
|
|
1181
1214
|
/** An object for an inline keyboard. */
|
|
1182
1215
|
reply_markup?: InlineKeyboardMarkup;
|
|
1183
1216
|
}): (Update.Edited & Message.CaptionableMessage) | true;
|
|
1184
|
-
/** Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
1217
|
+
/** Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1185
1218
|
editMessageMedia(args: {
|
|
1219
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1220
|
+
business_connection_id?: string;
|
|
1186
1221
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1187
1222
|
chat_id?: number | string;
|
|
1188
1223
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -1194,8 +1229,10 @@ export type ApiMethods<F> = {
|
|
|
1194
1229
|
/** An object for a new inline keyboard. */
|
|
1195
1230
|
reply_markup?: InlineKeyboardMarkup;
|
|
1196
1231
|
}): (Update.Edited & Message) | true;
|
|
1197
|
-
/** Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
1232
|
+
/** Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1198
1233
|
editMessageReplyMarkup(args: {
|
|
1234
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1235
|
+
business_connection_id?: string;
|
|
1199
1236
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1200
1237
|
chat_id?: number | string;
|
|
1201
1238
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -1207,6 +1244,8 @@ export type ApiMethods<F> = {
|
|
|
1207
1244
|
}): (Update.Edited & Message) | true;
|
|
1208
1245
|
/** Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned. */
|
|
1209
1246
|
stopPoll(args: {
|
|
1247
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1248
|
+
business_connection_id?: string;
|
|
1210
1249
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1211
1250
|
chat_id: number | string;
|
|
1212
1251
|
/** Identifier of the original message with the poll */
|
|
@@ -1253,7 +1292,7 @@ export type ApiMethods<F> = {
|
|
|
1253
1292
|
disable_notification?: boolean;
|
|
1254
1293
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1255
1294
|
protect_content?: boolean;
|
|
1256
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
1295
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
1257
1296
|
message_effect_id?: string;
|
|
1258
1297
|
/** Description of the message to reply to */
|
|
1259
1298
|
reply_parameters?: ReplyParameters;
|
|
@@ -1456,7 +1495,7 @@ export type ApiMethods<F> = {
|
|
|
1456
1495
|
disable_notification?: boolean;
|
|
1457
1496
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1458
1497
|
protect_content?: boolean;
|
|
1459
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
1498
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
1460
1499
|
message_effect_id?: string;
|
|
1461
1500
|
/** Description of the message to reply to */
|
|
1462
1501
|
reply_parameters?: ReplyParameters;
|
|
@@ -1528,6 +1567,13 @@ export type ApiMethods<F> = {
|
|
|
1528
1567
|
/** Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. */
|
|
1529
1568
|
error_message?: string;
|
|
1530
1569
|
}): true;
|
|
1570
|
+
/** Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object. */
|
|
1571
|
+
getStarTransactions(args: {
|
|
1572
|
+
/** Number of transactions to skip in the response */
|
|
1573
|
+
offset?: number;
|
|
1574
|
+
/** The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100. */
|
|
1575
|
+
limit?: number;
|
|
1576
|
+
}): StarTransactions;
|
|
1531
1577
|
/** Refunds a successful payment in Telegram Stars. Returns True on success. */
|
|
1532
1578
|
refundStarPayment(args: {
|
|
1533
1579
|
/** Identifier of the user whose payment will be refunded */
|
|
@@ -1558,7 +1604,7 @@ export type ApiMethods<F> = {
|
|
|
1558
1604
|
disable_notification?: boolean;
|
|
1559
1605
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1560
1606
|
protect_content?: boolean;
|
|
1561
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
1607
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
1562
1608
|
message_effect_id?: string;
|
|
1563
1609
|
/** Description of the message to reply to */
|
|
1564
1610
|
reply_parameters?: ReplyParameters;
|
|
@@ -1725,4 +1771,33 @@ export interface InputMediaDocument<F> {
|
|
|
1725
1771
|
/** Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always true, if the document is sent as part of an album. */
|
|
1726
1772
|
disable_content_type_detection?: boolean;
|
|
1727
1773
|
}
|
|
1774
|
+
/** This object describes the paid media to be sent. Currently, it can be one of
|
|
1775
|
+
|
|
1776
|
+
- InputPaidMediaPhoto
|
|
1777
|
+
- InputPaidMediaVideo */
|
|
1778
|
+
export type InputPaidMedia<F> = InputMediaPhoto<F> | InputPaidMediaVideo<F>;
|
|
1779
|
+
/** The paid media to send is a photo. */
|
|
1780
|
+
export interface InputPaidMediaPhoto<F> {
|
|
1781
|
+
/** Type of the media, must be photo */
|
|
1782
|
+
type: "photo";
|
|
1783
|
+
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » */
|
|
1784
|
+
media: F | string;
|
|
1785
|
+
}
|
|
1786
|
+
/** The paid media to send is a video. */
|
|
1787
|
+
export interface InputPaidMediaVideo<F> {
|
|
1788
|
+
/** Type of the media, must be video */
|
|
1789
|
+
type: "video";
|
|
1790
|
+
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » */
|
|
1791
|
+
media: F | string;
|
|
1792
|
+
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » */
|
|
1793
|
+
thumbnail?: F | string;
|
|
1794
|
+
/** Video width */
|
|
1795
|
+
width?: number;
|
|
1796
|
+
/** Video height */
|
|
1797
|
+
height?: number;
|
|
1798
|
+
/** Video duration in seconds */
|
|
1799
|
+
duration?: number;
|
|
1800
|
+
/** Pass True if the uploaded video is suitable for streaming */
|
|
1801
|
+
supports_streaming?: boolean;
|
|
1802
|
+
}
|
|
1728
1803
|
export {};
|
package/package.json
CHANGED
package/payment.d.ts
CHANGED
|
@@ -99,3 +99,79 @@ export interface PreCheckoutQuery {
|
|
|
99
99
|
/** Order information provided by the user */
|
|
100
100
|
order_info?: OrderInfo;
|
|
101
101
|
}
|
|
102
|
+
/** This object describes the state of a revenue withdrawal operation. Currently, it can be one of
|
|
103
|
+
|
|
104
|
+
- RevenueWithdrawalStatePending
|
|
105
|
+
- RevenueWithdrawalStateSucceeded
|
|
106
|
+
- RevenueWithdrawalStateFailed */
|
|
107
|
+
export type RevenueWithdrawalState = RevenueWithdrawalStatePending | RevenueWithdrawalStateSucceeded | RevenueWithdrawalStateFailed;
|
|
108
|
+
/** The withdrawal is in progress. */
|
|
109
|
+
export interface RevenueWithdrawalStatePending {
|
|
110
|
+
/** Type of the state, always “pending” */
|
|
111
|
+
type: "pending";
|
|
112
|
+
}
|
|
113
|
+
/** The withdrawal succeeded. */
|
|
114
|
+
export interface RevenueWithdrawalStateSucceeded {
|
|
115
|
+
/** Type of the state, always “succeeded” */
|
|
116
|
+
type: "succeeded";
|
|
117
|
+
/** Date the withdrawal was completed in Unix time */
|
|
118
|
+
date: number;
|
|
119
|
+
/** An HTTPS URL that can be used to see transaction details */
|
|
120
|
+
url: string;
|
|
121
|
+
}
|
|
122
|
+
/** The withdrawal failed and the transaction was refunded. */
|
|
123
|
+
export interface RevenueWithdrawalStateFailed {
|
|
124
|
+
/** Type of the state, always “failed” */
|
|
125
|
+
type: "failed";
|
|
126
|
+
}
|
|
127
|
+
/** This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
|
|
128
|
+
|
|
129
|
+
- TransactionPartnerUser
|
|
130
|
+
- TransactionPartnerFragment
|
|
131
|
+
- TransactionPartnerTelegramAds
|
|
132
|
+
- TransactionPartnerOther */
|
|
133
|
+
export type TransactionPartner = TransactionPartnerUser | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerOther;
|
|
134
|
+
/** Describes a transaction with a user. */
|
|
135
|
+
export interface TransactionPartnerUser {
|
|
136
|
+
/** Type of the transaction partner, always “user” */
|
|
137
|
+
type: "user";
|
|
138
|
+
/** Information about the user */
|
|
139
|
+
user: User;
|
|
140
|
+
/** Bot-specified invoice payload */
|
|
141
|
+
invoice_payload?: string;
|
|
142
|
+
}
|
|
143
|
+
/** Describes a withdrawal transaction with Fragment. */
|
|
144
|
+
export interface TransactionPartnerFragment {
|
|
145
|
+
/** Type of the transaction partner, always “fragment” */
|
|
146
|
+
type: "fragment";
|
|
147
|
+
/** State of the transaction if the transaction is outgoing */
|
|
148
|
+
withdrawal_state?: RevenueWithdrawalState;
|
|
149
|
+
}
|
|
150
|
+
/** Describes a withdrawal transaction to the Telegram Ads platform. */
|
|
151
|
+
export interface TransactionPartnerTelegramAds {
|
|
152
|
+
/** Type of the transaction partner, always “telegram_ads” */
|
|
153
|
+
type: "telegram_ads";
|
|
154
|
+
}
|
|
155
|
+
/** Describes a transaction with an unknown source or recipient. */
|
|
156
|
+
export interface TransactionPartnerOther {
|
|
157
|
+
/** Type of the transaction partner, always “other” */
|
|
158
|
+
type: "other";
|
|
159
|
+
}
|
|
160
|
+
/** Describes a Telegram Star transaction. */
|
|
161
|
+
export interface StarTransaction {
|
|
162
|
+
/** Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. */
|
|
163
|
+
id: string;
|
|
164
|
+
/** Number of Telegram Stars transferred by the transaction */
|
|
165
|
+
amount: number;
|
|
166
|
+
/** Date the transaction was created in Unix time */
|
|
167
|
+
date: number;
|
|
168
|
+
/** Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions */
|
|
169
|
+
source?: TransactionPartner;
|
|
170
|
+
/** Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions */
|
|
171
|
+
receiver?: TransactionPartner;
|
|
172
|
+
}
|
|
173
|
+
/** Contains a list of Telegram Star transactions. */
|
|
174
|
+
export interface StarTransactions {
|
|
175
|
+
/** The list of transactions */
|
|
176
|
+
transactions: StarTransaction[];
|
|
177
|
+
}
|
package/settings.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export interface MenuButtonWebApp {
|
|
|
32
32
|
type: "web_app";
|
|
33
33
|
/** Text on the button */
|
|
34
34
|
text: string;
|
|
35
|
-
/** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. */
|
|
35
|
+
/** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Alternatively, a t.me link to a Web App can be specified in the object instead of the Web App's URL, in which case the Web App will be opened as if the user pressed the link. */
|
|
36
36
|
web_app: WebAppInfo;
|
|
37
37
|
}
|
|
38
38
|
/** Describes that no specific value for the menu button was set. */
|