@grammyjs/types 3.23.0 → 3.25.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/checklist.d.ts +1 -1
- package/manage.d.ts +41 -2
- package/markup.d.ts +11 -3
- package/message.d.ts +59 -4
- package/methods.d.ts +31 -4
- package/package.json +1 -1
- package/payment.d.ts +5 -1
package/checklist.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface InputChecklistTask {
|
|
|
35
35
|
/** Text of the task; 1-100 characters after entities parsing */
|
|
36
36
|
text: string;
|
|
37
37
|
/** Mode for parsing entities in the text. See formatting options for more details. */
|
|
38
|
-
parse_mode?:
|
|
38
|
+
parse_mode?: ParseMode;
|
|
39
39
|
/** List of special entities that appear in the text, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are allowed. */
|
|
40
40
|
text_entities?: MessageEntity[];
|
|
41
41
|
}
|
package/manage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Location, Message, PhotoSize, ReactionType, Sticker } from "./message.js";
|
|
1
|
+
import type { Audio, Location, Message, PhotoSize, ReactionType, Sticker } from "./message.js";
|
|
2
2
|
import type { UniqueGiftColors } from "./payment.js";
|
|
3
3
|
import type { Update } from "./update.js";
|
|
4
4
|
/** Describes the current status of a webhook. */
|
|
@@ -69,7 +69,19 @@ export interface UserFromGetMe extends User {
|
|
|
69
69
|
/** True, if the bot has main Web App. Returned only in getMe. */
|
|
70
70
|
has_main_web_app: boolean;
|
|
71
71
|
/** True, if the bot has forum topic mode enabled in private chats. Returned only in getMe. */
|
|
72
|
-
has_topics_enabled
|
|
72
|
+
has_topics_enabled: boolean;
|
|
73
|
+
/** True, if the bot allows users to create and delete topics in private chats. Returned only in getMe. */
|
|
74
|
+
allows_users_to_create_topics: boolean;
|
|
75
|
+
}
|
|
76
|
+
/** Describes a service message about the chat owner leaving the chat. */
|
|
77
|
+
export interface ChatOwnerLeft {
|
|
78
|
+
/** The user which will be the new owner of the chat if the previous owner does not return to the chat */
|
|
79
|
+
new_owner?: User;
|
|
80
|
+
}
|
|
81
|
+
/** Describes a service message about an ownership change in the chat. */
|
|
82
|
+
export interface ChatOwnerChanged {
|
|
83
|
+
/** The new owner of the chat */
|
|
84
|
+
new_owner: User;
|
|
73
85
|
}
|
|
74
86
|
/** This object describes the rating of a user based on their Telegram Star spendings. */
|
|
75
87
|
export interface UserRating {
|
|
@@ -187,6 +199,8 @@ export declare namespace ChatFullInfo {
|
|
|
187
199
|
max_reaction_count: number;
|
|
188
200
|
/** Chat photo */
|
|
189
201
|
photo?: ChatPhoto;
|
|
202
|
+
/** For private chats, the first audio added to the profile of the user */
|
|
203
|
+
first_profile_audio?: Audio;
|
|
190
204
|
/** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
|
|
191
205
|
active_usernames?: string[];
|
|
192
206
|
/** For private chats, the date of birth of the user */
|
|
@@ -288,6 +302,8 @@ export declare namespace ChatFullInfo {
|
|
|
288
302
|
max_reaction_count: number;
|
|
289
303
|
/** Chat photo */
|
|
290
304
|
photo?: ChatPhoto;
|
|
305
|
+
/** For private chats, the first audio added to the profile of the user */
|
|
306
|
+
first_profile_audio?: undefined;
|
|
291
307
|
/** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
|
|
292
308
|
active_usernames?: undefined;
|
|
293
309
|
/** For private chats, the date of birth of the user */
|
|
@@ -389,6 +405,8 @@ export declare namespace ChatFullInfo {
|
|
|
389
405
|
max_reaction_count: number;
|
|
390
406
|
/** Chat photo */
|
|
391
407
|
photo?: ChatPhoto;
|
|
408
|
+
/** For private chats, the first audio added to the profile of the user */
|
|
409
|
+
first_profile_audio?: undefined;
|
|
392
410
|
/** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
|
|
393
411
|
active_usernames?: string[];
|
|
394
412
|
/** For private chats, the date of birth of the user */
|
|
@@ -490,6 +508,8 @@ export declare namespace ChatFullInfo {
|
|
|
490
508
|
max_reaction_count: number;
|
|
491
509
|
/** Chat photo */
|
|
492
510
|
photo?: ChatPhoto;
|
|
511
|
+
/** For private chats, the first audio added to the profile of the user */
|
|
512
|
+
first_profile_audio?: undefined;
|
|
493
513
|
/** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
|
|
494
514
|
active_usernames?: string[];
|
|
495
515
|
/** For private chats, the date of birth of the user */
|
|
@@ -579,6 +599,13 @@ export interface UserProfilePhotos {
|
|
|
579
599
|
/** Requested profile pictures (in up to 4 sizes each) */
|
|
580
600
|
photos: PhotoSize[][];
|
|
581
601
|
}
|
|
602
|
+
/** This object represents the audios displayed on a user's profile. */
|
|
603
|
+
export interface UserProfileAudios {
|
|
604
|
+
/** Total number of profile audios for the target user */
|
|
605
|
+
total_count: number;
|
|
606
|
+
/** Requested profile audios */
|
|
607
|
+
audios: Audio[];
|
|
608
|
+
}
|
|
582
609
|
/** This object represents a chat photo. */
|
|
583
610
|
export interface ChatPhoto {
|
|
584
611
|
/** 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. */
|
|
@@ -633,6 +660,8 @@ export interface ChatAdministratorRights {
|
|
|
633
660
|
can_change_info: boolean;
|
|
634
661
|
/** True, if the user is allowed to invite new users to the chat */
|
|
635
662
|
can_invite_users: boolean;
|
|
663
|
+
/** True, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted defaults to the value of can_pin_messages. */
|
|
664
|
+
can_manage_tags?: boolean;
|
|
636
665
|
/** True, if the administrator can post stories to the chat */
|
|
637
666
|
can_post_stories: boolean;
|
|
638
667
|
/** True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive */
|
|
@@ -712,6 +741,8 @@ export interface ChatMemberAdministrator {
|
|
|
712
741
|
can_change_info: boolean;
|
|
713
742
|
/** True, if the user is allowed to invite new users to the chat */
|
|
714
743
|
can_invite_users: boolean;
|
|
744
|
+
/** True, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted defaults to the value of can_pin_messages. */
|
|
745
|
+
can_manage_tags?: boolean;
|
|
715
746
|
/** True, if the administrator can post stories to the chat */
|
|
716
747
|
can_post_stories: boolean;
|
|
717
748
|
/** True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive */
|
|
@@ -737,6 +768,8 @@ export interface ChatMemberMember {
|
|
|
737
768
|
status: "member";
|
|
738
769
|
/** Information about the user */
|
|
739
770
|
user: User;
|
|
771
|
+
/** Tag of the member */
|
|
772
|
+
tag?: string;
|
|
740
773
|
/** Date when the user's subscription will expire; Unix time */
|
|
741
774
|
until_date?: number;
|
|
742
775
|
}
|
|
@@ -746,6 +779,8 @@ export interface ChatMemberRestricted {
|
|
|
746
779
|
status: "restricted";
|
|
747
780
|
/** Information about the user */
|
|
748
781
|
user: User;
|
|
782
|
+
/** Tag of the member */
|
|
783
|
+
tag?: string;
|
|
749
784
|
/** True, if the user is a member of the chat at the moment of the request */
|
|
750
785
|
is_member: boolean;
|
|
751
786
|
/** True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues */
|
|
@@ -772,6 +807,8 @@ export interface ChatMemberRestricted {
|
|
|
772
807
|
can_change_info: boolean;
|
|
773
808
|
/** True, if the user is allowed to invite new users to the chat */
|
|
774
809
|
can_invite_users: boolean;
|
|
810
|
+
/** True, if the user is allowed to edit their own tag */
|
|
811
|
+
can_edit_tag: boolean;
|
|
775
812
|
/** True, if the user is allowed to pin messages */
|
|
776
813
|
can_pin_messages: boolean;
|
|
777
814
|
/** True, if the user is allowed to create forum topics */
|
|
@@ -836,6 +873,8 @@ export interface ChatPermissions {
|
|
|
836
873
|
can_change_info?: boolean;
|
|
837
874
|
/** True, if the user is allowed to invite new users to the chat */
|
|
838
875
|
can_invite_users?: boolean;
|
|
876
|
+
/** True, if the user is allowed to edit their own tag */
|
|
877
|
+
can_edit_tag?: boolean;
|
|
839
878
|
/** True, if the user is allowed to pin messages. Ignored in public supergroups */
|
|
840
879
|
can_pin_messages?: boolean;
|
|
841
880
|
/** True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages */
|
package/markup.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ export declare namespace InlineKeyboardButton {
|
|
|
9
9
|
interface AbstractInlineKeyboardButton {
|
|
10
10
|
/** Label text on the button */
|
|
11
11
|
text: string;
|
|
12
|
+
/** Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription. */
|
|
13
|
+
icon_custom_emoji_id?: string;
|
|
14
|
+
/** Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used. */
|
|
15
|
+
style?: "danger" | "success" | "primary";
|
|
12
16
|
}
|
|
13
17
|
interface UrlButton extends AbstractInlineKeyboardButton {
|
|
14
18
|
/** HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings. */
|
|
@@ -57,7 +61,7 @@ export declare namespace InlineKeyboardButton {
|
|
|
57
61
|
pay: boolean;
|
|
58
62
|
}
|
|
59
63
|
}
|
|
60
|
-
/** This object represents one button of an inline keyboard.
|
|
64
|
+
/** This object represents one button of an inline keyboard. Exactly one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. */
|
|
61
65
|
export type InlineKeyboardButton = InlineKeyboardButton.CallbackButton | InlineKeyboardButton.GameButton | InlineKeyboardButton.LoginButton | InlineKeyboardButton.PayButton | InlineKeyboardButton.SwitchInlineButton | InlineKeyboardButton.SwitchInlineCurrentChatButton | InlineKeyboardButton.SwitchInlineChosenChatButton | InlineKeyboardButton.CopyTextButtonButton | InlineKeyboardButton.UrlButton | InlineKeyboardButton.WebAppButton;
|
|
62
66
|
/** This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in.
|
|
63
67
|
Telegram apps support these buttons as of version 5.7. */
|
|
@@ -127,8 +131,12 @@ export interface ReplyKeyboardMarkup {
|
|
|
127
131
|
}
|
|
128
132
|
export declare namespace KeyboardButton {
|
|
129
133
|
interface CommonButton {
|
|
130
|
-
/** Text of the button. If none of the
|
|
134
|
+
/** Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed */
|
|
131
135
|
text: string;
|
|
136
|
+
/** Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription. */
|
|
137
|
+
icon_custom_emoji_id?: string;
|
|
138
|
+
/** Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used. */
|
|
139
|
+
style?: "danger" | "success" | "primary";
|
|
132
140
|
}
|
|
133
141
|
interface RequestUsersButton extends CommonButton {
|
|
134
142
|
/** If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only. */
|
|
@@ -155,7 +163,7 @@ export declare namespace KeyboardButton {
|
|
|
155
163
|
web_app: WebAppInfo;
|
|
156
164
|
}
|
|
157
165
|
}
|
|
158
|
-
/** This object represents one button of the reply keyboard. At most one of the
|
|
166
|
+
/** This object represents one button of the reply keyboard. At most one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. For simple text buttons, String can be used instead of this object to specify the button text. */
|
|
159
167
|
export type KeyboardButton = KeyboardButton.CommonButton | KeyboardButton.RequestUsersButton | KeyboardButton.RequestChatButton | KeyboardButton.RequestContactButton | KeyboardButton.RequestLocationButton | KeyboardButton.RequestPollButton | KeyboardButton.WebAppButton | string;
|
|
160
168
|
/** This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. */
|
|
161
169
|
export interface KeyboardButtonPollType {
|
package/message.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Checklist, ChecklistTasksAdded, ChecklistTasksDone } from "./checklist.js";
|
|
2
|
-
import type { Chat, User } from "./manage.js";
|
|
2
|
+
import type { Chat, ChatOwnerChanged, ChatOwnerLeft, User } from "./manage.js";
|
|
3
3
|
import type { InlineKeyboardMarkup } from "./markup.js";
|
|
4
4
|
import type { PassportData } from "./passport.js";
|
|
5
5
|
import type { GiftInfo, Invoice, PaidMessagePriceChanged, RefundedPayment, SuccessfulPayment, SuggestedPostApprovalFailed, SuggestedPostApproved, SuggestedPostDeclined, SuggestedPostInfo, SuggestedPostPaid, SuggestedPostPrice, SuggestedPostRefunded, UniqueGiftInfo } from "./payment.js";
|
|
@@ -26,6 +26,8 @@ export declare namespace Message {
|
|
|
26
26
|
direct_messages_topic?: DirectMessagesTopic;
|
|
27
27
|
}
|
|
28
28
|
interface CommonMessage extends ServiceMessage {
|
|
29
|
+
/** Tag or custom title of the sender of the message; for supergroups only */
|
|
30
|
+
sender_tag?: string;
|
|
29
31
|
/** If the sender of the message boosted the chat, the number of boosts added by the user */
|
|
30
32
|
sender_boost_count?: number;
|
|
31
33
|
/** The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account. */
|
|
@@ -74,7 +76,7 @@ export declare namespace Message {
|
|
|
74
76
|
caption_entities?: MessageEntity[];
|
|
75
77
|
}
|
|
76
78
|
interface MediaMessage extends CaptionableMessage {
|
|
77
|
-
/** The unique identifier of a media message group this message belongs to */
|
|
79
|
+
/** The unique identifier inside this chat of a media message group this message belongs to */
|
|
78
80
|
media_group_id?: string;
|
|
79
81
|
/** True, if the message media is covered by a spoiler animation */
|
|
80
82
|
has_media_spoiler?: true;
|
|
@@ -106,6 +108,8 @@ export declare namespace Message {
|
|
|
106
108
|
type SuggestedPostDeclinedMessage = ServiceMessage & MsgWith<"suggested_post_declined">;
|
|
107
109
|
type SuggestedPostPaidMessage = ServiceMessage & MsgWith<"suggested_post_paid">;
|
|
108
110
|
type SuggestedPostRefundedMessage = ServiceMessage & MsgWith<"suggested_post_refunded">;
|
|
111
|
+
type ChatOwnerLeftMessage = ServiceMessage & MsgWith<"chat_owner_left">;
|
|
112
|
+
type ChatOwnerChangedMessage = ServiceMessage & MsgWith<"chat_owner_changed">;
|
|
109
113
|
type NewChatMembersMessage = ServiceMessage & MsgWith<"new_chat_members">;
|
|
110
114
|
type LeftChatMemberMessage = ServiceMessage & MsgWith<"left_chat_member">;
|
|
111
115
|
type NewChatTitleMessage = ServiceMessage & MsgWith<"new_chat_title">;
|
|
@@ -208,6 +212,10 @@ export interface Message extends Message.MediaMessage {
|
|
|
208
212
|
suggested_post_paid?: SuggestedPostPaid;
|
|
209
213
|
/** Service message: payment for a suggested post was refunded */
|
|
210
214
|
suggested_post_refunded?: SuggestedPostRefunded;
|
|
215
|
+
/** Service message: chat owner has left */
|
|
216
|
+
chat_owner_left?: ChatOwnerLeft;
|
|
217
|
+
/** Service message: chat owner has changed */
|
|
218
|
+
chat_owner_changed?: ChatOwnerChanged;
|
|
211
219
|
/** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
|
|
212
220
|
new_chat_members?: User[];
|
|
213
221
|
/** A member was removed from the group, information about them (this member may be the bot itself) */
|
|
@@ -335,6 +343,19 @@ Links `tg://user?id=<user_id>` can be used to mention a user by their identifier
|
|
|
335
343
|
|
|
336
344
|
You can find the list of programming and markup languages for which syntax highlighting is supported at [libprisma#supported-languages](https://github.com/TelegramMessenger/libprisma#supported-languages).
|
|
337
345
|
|
|
346
|
+
#### Date-time entity formatting
|
|
347
|
+
|
|
348
|
+
Date-time entity formatting is specified by a format string, which must adhere to the following regular expression: `r|w?[dD]?[tT]?`.
|
|
349
|
+
|
|
350
|
+
If the format string is empty, the underlying text is displayed as-is; however, the user can still receive the underlying date in their local format. When populated, the format string determines the output based on the presence of the following control characters:
|
|
351
|
+
|
|
352
|
+
- `r`: Displays the time relative to the current time. Cannot be combined with any other control characters.
|
|
353
|
+
- `w`: Displays the day of the week in the user's localized language.
|
|
354
|
+
- `d`: Displays the date in short form (e.g., “17.03.22”).
|
|
355
|
+
- `D`: Displays the date in long form (e.g., “March 17, 2022”).
|
|
356
|
+
- `t`: Displays the time in short form (e.g., “22:45”).
|
|
357
|
+
- `T`: Displays the time in long form (e.g., “22:45:00”).
|
|
358
|
+
|
|
338
359
|
#### MarkdownV2 style
|
|
339
360
|
To use this mode, pass *MarkdownV2* in the *parse_mode* field. Use the following syntax in your message:
|
|
340
361
|
|
|
@@ -348,6 +369,10 @@ __underline__
|
|
|
348
369
|
[inline URL](http://www.example.com/)
|
|
349
370
|
[inline mention of a user](tg://user?id=123456789)
|
|
350
371
|

|
|
372
|
+

|
|
373
|
+

|
|
374
|
+

|
|
375
|
+

|
|
351
376
|
`inline fixed-width code`
|
|
352
377
|
```
|
|
353
378
|
pre-formatted fixed-width code block
|
|
@@ -376,6 +401,7 @@ Please note:
|
|
|
376
401
|
- In case of ambiguity between `italic` and `underline` entities `__` is always greedily treated from left to right as beginning or end of an `underline` entity, so instead of `___italic underline___` use `___italic underline_**__`, adding an empty bold entity as a separator.
|
|
377
402
|
- A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.
|
|
378
403
|
- Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
|
|
404
|
+
- See date-time entity formatting for more details about supported date-time formats.
|
|
379
405
|
|
|
380
406
|
#### HTML style
|
|
381
407
|
To use this mode, pass *HTML* in the *parse_mode* field. The following tags are currently supported:
|
|
@@ -390,6 +416,10 @@ To use this mode, pass *HTML* in the *parse_mode* field. The following tags are
|
|
|
390
416
|
<a href="http://www.example.com/">inline URL</a>
|
|
391
417
|
<a href="tg://user?id=123456789">inline mention of a user</a>
|
|
392
418
|
<tg-emoji emoji-id="5368324170671202286">👍</tg-emoji>
|
|
419
|
+
<tg-time unix="1647531900" format="wDT">22:45 tomorrow</tg-time>
|
|
420
|
+
<tg-time unix="1647531900" format="t">22:45 tomorrow</tg-time>
|
|
421
|
+
<tg-time unix="1647531900" format="r">22:45 tomorrow</tg-time>
|
|
422
|
+
<tg-time unix="1647531900">22:45 tomorrow</tg-time>
|
|
393
423
|
<code>inline fixed-width code</code>
|
|
394
424
|
<pre>pre-formatted fixed-width code block</pre>
|
|
395
425
|
<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
|
|
@@ -406,6 +436,7 @@ Please note:
|
|
|
406
436
|
- Programming language can't be specified for standalone `code` tags.
|
|
407
437
|
- A valid emoji must be used as the content of the tg-emoji tag. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.
|
|
408
438
|
- Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
|
|
439
|
+
- See date-time entity formatting for more details about supported date-time formats.
|
|
409
440
|
|
|
410
441
|
#### Markdown style
|
|
411
442
|
This is a legacy mode, retained for backward compatibility. To use this mode, pass *Markdown* in the *parse_mode* field. Use the following syntax in your message:
|
|
@@ -432,7 +463,7 @@ Please note:
|
|
|
432
463
|
export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
|
|
433
464
|
export declare namespace MessageEntity {
|
|
434
465
|
interface AbstractMessageEntity {
|
|
435
|
-
/** Type of the entity. Currently, can be “mention” (
|
|
466
|
+
/** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time) */
|
|
436
467
|
type: string;
|
|
437
468
|
/** Offset in UTF-16 code units to the start of the entity */
|
|
438
469
|
offset: number;
|
|
@@ -462,9 +493,16 @@ export declare namespace MessageEntity {
|
|
|
462
493
|
/** For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker */
|
|
463
494
|
custom_emoji_id: string;
|
|
464
495
|
}
|
|
496
|
+
interface DateTimeMessageEntity extends AbstractMessageEntity {
|
|
497
|
+
type: "date_time";
|
|
498
|
+
/** For “date_time” only, the Unix time associated with the entity */
|
|
499
|
+
unix_time: number;
|
|
500
|
+
/** For “date_time” only, the string that defines the formatting of the date and time. See date-time entity formatting for more details. */
|
|
501
|
+
date_time_format: "r" | `${"w" | ""}${"d" | "D" | ""}${"t" | "T" | ""}`;
|
|
502
|
+
}
|
|
465
503
|
}
|
|
466
504
|
/** This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. */
|
|
467
|
-
export type MessageEntity = MessageEntity.CommonMessageEntity | MessageEntity.CustomEmojiMessageEntity | MessageEntity.PreMessageEntity | MessageEntity.TextLinkMessageEntity | MessageEntity.TextMentionMessageEntity;
|
|
505
|
+
export type MessageEntity = MessageEntity.CommonMessageEntity | MessageEntity.CustomEmojiMessageEntity | MessageEntity.PreMessageEntity | MessageEntity.TextLinkMessageEntity | MessageEntity.TextMentionMessageEntity | MessageEntity.DateTimeMessageEntity;
|
|
468
506
|
/** This object contains information about the quoted part of a message that is replied to by the given message. */
|
|
469
507
|
export interface TextQuote {
|
|
470
508
|
/** Text of the quoted part of a message that is replied to by the given message */
|
|
@@ -698,6 +736,23 @@ export interface Video {
|
|
|
698
736
|
mime_type?: string;
|
|
699
737
|
/** File size in bytes */
|
|
700
738
|
file_size?: number;
|
|
739
|
+
/** List of available qualities of the video. */
|
|
740
|
+
qualities?: VideoQuality[];
|
|
741
|
+
}
|
|
742
|
+
/** This object represents a video file of a specific quality. */
|
|
743
|
+
export interface VideoQuality {
|
|
744
|
+
/** Identifier for this file, which can be used to download or reuse the file */
|
|
745
|
+
file_id: string;
|
|
746
|
+
/** 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. */
|
|
747
|
+
file_unique_id: string;
|
|
748
|
+
/** Video width */
|
|
749
|
+
width: number;
|
|
750
|
+
/** Video height */
|
|
751
|
+
height: number;
|
|
752
|
+
/** Codec that was used to encode the video, for example, “h264”, “h265”, or “av01” */
|
|
753
|
+
codec: string;
|
|
754
|
+
/** 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. */
|
|
755
|
+
file_size?: number;
|
|
701
756
|
}
|
|
702
757
|
/** This object represents a video message (available in Telegram apps as of v.4.0). */
|
|
703
758
|
export interface VideoNote {
|
package/methods.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { InputChecklist } from "./checklist.js";
|
|
2
2
|
import type { InlineQueryResult, InlineQueryResultsButton } from "./inline.js";
|
|
3
3
|
import type { LanguageCode } from "./langs.js";
|
|
4
|
-
import type { AcceptedGiftTypes, BotCommand, BusinessConnection, ChatAdministratorRights, ChatFullInfo, ChatInviteLink, ChatMember, ChatMemberAdministrator, ChatMemberOwner, ChatPermissions, ForumTopic, UserChatBoosts, UserFromGetMe, UserProfilePhotos, WebhookInfo } from "./manage.js";
|
|
4
|
+
import type { AcceptedGiftTypes, BotCommand, BusinessConnection, ChatAdministratorRights, ChatFullInfo, ChatInviteLink, ChatMember, ChatMemberAdministrator, ChatMemberOwner, ChatPermissions, ForumTopic, UserChatBoosts, UserFromGetMe, UserProfileAudios, UserProfilePhotos, WebhookInfo } from "./manage.js";
|
|
5
5
|
import type { ForceReply, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "./markup.js";
|
|
6
6
|
import type { File, GameHighScore, InputPollOption, LinkPreviewOptions, MaskPosition, Message, MessageEntity, MessageId, ParseMode, Poll, PreparedInlineMessage, ReactionType, ReplyParameters, SentWebAppMessage, Sticker, StickerSet, Story, SuggestedPostParameters } from "./message.js";
|
|
7
7
|
import type { PassportElementError } from "./passport.js";
|
|
@@ -110,7 +110,7 @@ export type ApiMethods<F> = {
|
|
|
110
110
|
/** @deprecated Use `reply_parameters` instead. */
|
|
111
111
|
reply_to_message_id?: number;
|
|
112
112
|
}): Message.TextMessage;
|
|
113
|
-
/** Use this method to stream a partial message to a user while the message is being generated
|
|
113
|
+
/** Use this method to stream a partial message to a user while the message is being generated. Returns True on success. */
|
|
114
114
|
sendMessageDraft(args: {
|
|
115
115
|
/** Unique identifier for the target private chat */
|
|
116
116
|
chat_id: number;
|
|
@@ -883,6 +883,15 @@ export type ApiMethods<F> = {
|
|
|
883
883
|
/** Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. */
|
|
884
884
|
limit?: number;
|
|
885
885
|
}): UserProfilePhotos;
|
|
886
|
+
/** Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object. */
|
|
887
|
+
getUserProfileAudios(args: {
|
|
888
|
+
/** Unique identifier of the target user */
|
|
889
|
+
user_id: number;
|
|
890
|
+
/** Sequential number of the first audio to be returned. By default, all audios are returned. */
|
|
891
|
+
offset?: number;
|
|
892
|
+
/** Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100. */
|
|
893
|
+
limit?: number;
|
|
894
|
+
}): UserProfileAudios;
|
|
886
895
|
/** 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. */
|
|
887
896
|
setUserEmojiStatus(args: {
|
|
888
897
|
/** Unique identifier of the target user */
|
|
@@ -957,6 +966,8 @@ export type ApiMethods<F> = {
|
|
|
957
966
|
can_change_info?: boolean;
|
|
958
967
|
/** Pass True if the administrator can invite new users to the chat */
|
|
959
968
|
can_invite_users?: boolean;
|
|
969
|
+
/** Pass True if the administrator can edit the tags of regular members; for groups and supergroups only */
|
|
970
|
+
can_manage_tags?: boolean;
|
|
960
971
|
/** True if the administrator can post stories to the chat */
|
|
961
972
|
can_post_stories?: boolean;
|
|
962
973
|
/** Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive */
|
|
@@ -983,6 +994,15 @@ export type ApiMethods<F> = {
|
|
|
983
994
|
/** New custom title for the administrator; 0-16 characters, emoji are not allowed */
|
|
984
995
|
custom_title: string;
|
|
985
996
|
}): true;
|
|
997
|
+
/** Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the “can_manage_tags” administrator right. Returns True on success. */
|
|
998
|
+
setChatMemberTag(args: {
|
|
999
|
+
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
|
|
1000
|
+
chat_id: number | string;
|
|
1001
|
+
/** Unique identifier of the target user */
|
|
1002
|
+
user_id: number;
|
|
1003
|
+
/** New tag for the member; 0-16 characters, emoji are not allowed */
|
|
1004
|
+
tag?: string;
|
|
1005
|
+
}): true;
|
|
986
1006
|
/** Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success. */
|
|
987
1007
|
banChatSenderChat(args: {
|
|
988
1008
|
/** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
|
|
@@ -1195,7 +1215,7 @@ export type ApiMethods<F> = {
|
|
|
1195
1215
|
}): true;
|
|
1196
1216
|
/** 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. */
|
|
1197
1217
|
getForumTopicIconStickers(): Sticker[];
|
|
1198
|
-
/** Use this method to create a topic in a forum supergroup chat.
|
|
1218
|
+
/** 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. */
|
|
1199
1219
|
createForumTopic(args: {
|
|
1200
1220
|
/** Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`) */
|
|
1201
1221
|
chat_id: number | string;
|
|
@@ -1411,6 +1431,13 @@ export type ApiMethods<F> = {
|
|
|
1411
1431
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1412
1432
|
language_code?: LanguageCode;
|
|
1413
1433
|
}): BotShortDescription;
|
|
1434
|
+
/** Changes the profile photo of the bot. Returns True on success. */
|
|
1435
|
+
setMyProfilePhoto(args: {
|
|
1436
|
+
/** The new profile photo to set */
|
|
1437
|
+
photo: InputProfilePhoto<F>;
|
|
1438
|
+
}): true;
|
|
1439
|
+
/** Removes the profile photo of the bot. Requires no parameters. Returns True on success. */
|
|
1440
|
+
removeMyProfilePhoto(): true;
|
|
1414
1441
|
/** Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success. */
|
|
1415
1442
|
setChatMenuButton(args: {
|
|
1416
1443
|
/** Unique identifier for the target private chat. If not specified, default bot's menu button will be changed */
|
|
@@ -1889,7 +1916,7 @@ export type ApiMethods<F> = {
|
|
|
1889
1916
|
text_parse_mode?: ParseMode;
|
|
1890
1917
|
/** A list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. */
|
|
1891
1918
|
text_entities?: MessageEntity[];
|
|
1892
|
-
}):
|
|
1919
|
+
}): true;
|
|
1893
1920
|
/** Gifts a Telegram Premium subscription to the given user. Returns True on success. */
|
|
1894
1921
|
giftPremiumSubscription(args: {
|
|
1895
1922
|
/** Unique identifier of the target user who will receive a Telegram Premium subscription */
|
package/package.json
CHANGED
package/payment.d.ts
CHANGED
|
@@ -308,8 +308,10 @@ export interface UniqueGiftModel {
|
|
|
308
308
|
name: string;
|
|
309
309
|
/** The sticker that represents the unique gift */
|
|
310
310
|
sticker: Sticker;
|
|
311
|
-
/** The number of unique gifts that receive this model for every 1000 gifts
|
|
311
|
+
/** The number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts. */
|
|
312
312
|
rarity_per_mille: number;
|
|
313
|
+
/** Rarity of the model if it is a crafted model. Currently, can be “uncommon”, “rare”, “epic”, or “legendary”. */
|
|
314
|
+
rarity?: "uncommon" | "rare" | "epic" | "legendary";
|
|
313
315
|
}
|
|
314
316
|
/** This object describes the symbol shown on the pattern of a unique gift. */
|
|
315
317
|
export interface UniqueGiftSymbol {
|
|
@@ -364,6 +366,8 @@ export interface UniqueGift {
|
|
|
364
366
|
backdrop: UniqueGiftBackdrop;
|
|
365
367
|
/** The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews */
|
|
366
368
|
colors?: UniqueGiftColors;
|
|
369
|
+
/** True, if the gift was used to craft another gift and isn't available anymore */
|
|
370
|
+
is_burned?: true;
|
|
367
371
|
}
|
|
368
372
|
/** This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift. */
|
|
369
373
|
export interface UniqueGiftColors {
|