@grammyjs/types 3.21.0 → 3.22.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 +20 -0
- package/markup.d.ts +4 -4
- package/message.d.ts +42 -2
- package/methods.d.ts +105 -10
- package/package.json +1 -1
- package/payment.d.ts +62 -1
- package/settings.d.ts +3 -3
package/manage.d.ts
CHANGED
|
@@ -83,6 +83,8 @@ export declare namespace Chat {
|
|
|
83
83
|
last_name?: string;
|
|
84
84
|
/** True, if the supergroup chat is a forum (has topics enabled) */
|
|
85
85
|
is_forum?: undefined;
|
|
86
|
+
/** True, if the chat is the direct messages chat of a channel */
|
|
87
|
+
is_direct_messages?: undefined;
|
|
86
88
|
}
|
|
87
89
|
/** Internal type for group chats */
|
|
88
90
|
interface GroupChat {
|
|
@@ -100,6 +102,8 @@ export declare namespace Chat {
|
|
|
100
102
|
last_name?: undefined;
|
|
101
103
|
/** True, if the supergroup chat is a forum (has topics enabled) */
|
|
102
104
|
is_forum?: undefined;
|
|
105
|
+
/** True, if the chat is the direct messages chat of a channel */
|
|
106
|
+
is_direct_messages?: undefined;
|
|
103
107
|
}
|
|
104
108
|
/** Internal type for supergroup chats */
|
|
105
109
|
interface SupergroupChat {
|
|
@@ -117,6 +121,8 @@ export declare namespace Chat {
|
|
|
117
121
|
last_name?: undefined;
|
|
118
122
|
/** True, if the supergroup chat is a forum (has topics enabled) */
|
|
119
123
|
is_forum?: true;
|
|
124
|
+
/** True, if the chat is the direct messages chat of a channel */
|
|
125
|
+
is_direct_messages?: true;
|
|
120
126
|
}
|
|
121
127
|
/** Internal type for channel chats */
|
|
122
128
|
interface ChannelChat {
|
|
@@ -134,6 +140,8 @@ export declare namespace Chat {
|
|
|
134
140
|
last_name?: undefined;
|
|
135
141
|
/** True, if the supergroup chat is a forum (has topics enabled) */
|
|
136
142
|
is_forum?: undefined;
|
|
143
|
+
/** True, if the chat is the direct messages chat of a channel */
|
|
144
|
+
is_direct_messages?: undefined;
|
|
137
145
|
}
|
|
138
146
|
}
|
|
139
147
|
/** This object represents a chat. */
|
|
@@ -229,6 +237,8 @@ export declare namespace ChatFullInfo {
|
|
|
229
237
|
custom_emoji_sticker_set_name?: undefined;
|
|
230
238
|
/** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
|
|
231
239
|
linked_chat_id?: undefined;
|
|
240
|
+
/** Information about the corresponding channel chat; for direct messages chats only */
|
|
241
|
+
parent_chat?: undefined;
|
|
232
242
|
/** For supergroups, the location to which the supergroup is connected */
|
|
233
243
|
location?: undefined;
|
|
234
244
|
}
|
|
@@ -322,6 +332,8 @@ export declare namespace ChatFullInfo {
|
|
|
322
332
|
custom_emoji_sticker_set_name?: undefined;
|
|
323
333
|
/** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
|
|
324
334
|
linked_chat_id?: undefined;
|
|
335
|
+
/** Information about the corresponding channel chat; for direct messages chats only */
|
|
336
|
+
parent_chat?: undefined;
|
|
325
337
|
/** For supergroups, the location to which the supergroup is connected */
|
|
326
338
|
location?: undefined;
|
|
327
339
|
}
|
|
@@ -415,6 +427,8 @@ export declare namespace ChatFullInfo {
|
|
|
415
427
|
custom_emoji_sticker_set_name?: string;
|
|
416
428
|
/** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
|
|
417
429
|
linked_chat_id?: number;
|
|
430
|
+
/** Information about the corresponding channel chat; for direct messages chats only */
|
|
431
|
+
parent_chat?: Chat.ChannelChat;
|
|
418
432
|
/** For supergroups, the location to which the supergroup is connected */
|
|
419
433
|
location?: ChatLocation;
|
|
420
434
|
}
|
|
@@ -508,6 +522,8 @@ export declare namespace ChatFullInfo {
|
|
|
508
522
|
custom_emoji_sticker_set_name?: undefined;
|
|
509
523
|
/** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
|
|
510
524
|
linked_chat_id?: number;
|
|
525
|
+
/** Information about the corresponding channel chat; for direct messages chats only */
|
|
526
|
+
parent_chat?: undefined;
|
|
511
527
|
/** For supergroups, the location to which the supergroup is connected */
|
|
512
528
|
location?: undefined;
|
|
513
529
|
}
|
|
@@ -591,6 +607,8 @@ export interface ChatAdministratorRights {
|
|
|
591
607
|
can_pin_messages?: boolean;
|
|
592
608
|
/** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
|
|
593
609
|
can_manage_topics?: boolean;
|
|
610
|
+
/** True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
|
|
611
|
+
can_manage_direct_messages?: boolean;
|
|
594
612
|
}
|
|
595
613
|
/** This object represents changes in the status of a chat member. */
|
|
596
614
|
export interface ChatMemberUpdated {
|
|
@@ -668,6 +686,8 @@ export interface ChatMemberAdministrator {
|
|
|
668
686
|
can_pin_messages?: boolean;
|
|
669
687
|
/** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
|
|
670
688
|
can_manage_topics?: boolean;
|
|
689
|
+
/** True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
|
|
690
|
+
can_manage_direct_messages?: boolean;
|
|
671
691
|
/** Custom title for this user */
|
|
672
692
|
custom_title?: string;
|
|
673
693
|
}
|
package/markup.d.ts
CHANGED
|
@@ -27,17 +27,17 @@ export declare namespace InlineKeyboardButton {
|
|
|
27
27
|
login_url: LoginUrl;
|
|
28
28
|
}
|
|
29
29
|
interface SwitchInlineButton extends AbstractInlineKeyboardButton {
|
|
30
|
-
/** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent on behalf of a Telegram Business account. */
|
|
30
|
+
/** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account. */
|
|
31
31
|
switch_inline_query: string;
|
|
32
32
|
}
|
|
33
33
|
interface SwitchInlineCurrentChatButton extends AbstractInlineKeyboardButton {
|
|
34
|
-
/** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field.
|
|
34
|
+
/** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.
|
|
35
35
|
|
|
36
|
-
This offers a quick way for the user to open your bot in inline mode in the same chat
|
|
36
|
+
This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a Telegram Business account. */
|
|
37
37
|
switch_inline_query_current_chat: string;
|
|
38
38
|
}
|
|
39
39
|
interface SwitchInlineChosenChatButton extends AbstractInlineKeyboardButton {
|
|
40
|
-
/** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent on behalf of a Telegram Business account. */
|
|
40
|
+
/** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account. */
|
|
41
41
|
switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat;
|
|
42
42
|
}
|
|
43
43
|
interface CopyTextButtonButton extends AbstractInlineKeyboardButton {
|
package/message.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Checklist, ChecklistTasksAdded, ChecklistTasksDone } from "./check
|
|
|
2
2
|
import type { Chat, User } from "./manage.js";
|
|
3
3
|
import type { InlineKeyboardMarkup } from "./markup.js";
|
|
4
4
|
import type { PassportData } from "./passport.js";
|
|
5
|
-
import type { GiftInfo, Invoice, PaidMessagePriceChanged, RefundedPayment, SuccessfulPayment, UniqueGiftInfo } from "./payment.js";
|
|
5
|
+
import type { GiftInfo, Invoice, PaidMessagePriceChanged, RefundedPayment, SuccessfulPayment, SuggestedPostApprovalFailed, SuggestedPostApproved, SuggestedPostDeclined, SuggestedPostInfo, SuggestedPostPaid, SuggestedPostPrice, SuggestedPostRefunded, UniqueGiftInfo } from "./payment.js";
|
|
6
6
|
type MsgWith<P extends keyof Message> = Record<P, NonNullable<Message[P]>>;
|
|
7
7
|
export declare namespace Message {
|
|
8
8
|
interface ServiceMessage {
|
|
@@ -22,6 +22,8 @@ export declare namespace Message {
|
|
|
22
22
|
chat: Chat;
|
|
23
23
|
/** True, if the message is sent to a forum topic */
|
|
24
24
|
is_topic_message?: boolean;
|
|
25
|
+
/** Information about the direct messages chat topic that contains the message */
|
|
26
|
+
direct_messages_topic?: DirectMessagesTopic;
|
|
25
27
|
}
|
|
26
28
|
interface CommonMessage extends ServiceMessage {
|
|
27
29
|
/** If the sender of the message boosted the chat, the number of boosts added by the user */
|
|
@@ -34,6 +36,10 @@ export declare namespace Message {
|
|
|
34
36
|
is_automatic_forward?: true;
|
|
35
37
|
/** For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. */
|
|
36
38
|
reply_to_message?: ReplyMessage;
|
|
39
|
+
/** Identifier of the specific checklist task that is being replied to */
|
|
40
|
+
reply_to_checklist_task_id?: number;
|
|
41
|
+
/** True, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the payment and can't be edited. */
|
|
42
|
+
is_paid_post?: true;
|
|
37
43
|
/** Information about the message that is being replied to, which may come from another chat or forum topic */
|
|
38
44
|
external_reply?: ExternalReplyInfo;
|
|
39
45
|
/** For replies that quote part of the original message, the quoted part of the message */
|
|
@@ -94,6 +100,12 @@ export declare namespace Message {
|
|
|
94
100
|
type ChecklistMessage = CommonMessage & MsgWith<"checklist">;
|
|
95
101
|
type ChecklistTasksDoneMessage = ServiceMessage & MsgWith<"checklist_tasks_done">;
|
|
96
102
|
type ChecklistTasksAddedMessage = ServiceMessage & MsgWith<"checklist_tasks_added">;
|
|
103
|
+
type SuggestedPostInfoMessage = ServiceMessage & MsgWith<"suggested_post_info">;
|
|
104
|
+
type SuggestedPostApprovedMessage = ServiceMessage & MsgWith<"suggested_post_approved">;
|
|
105
|
+
type SuggestedPostApprovalFailedMessage = ServiceMessage & MsgWith<"suggested_post_approval_failed">;
|
|
106
|
+
type SuggestedPostDeclinedMessage = ServiceMessage & MsgWith<"suggested_post_declined">;
|
|
107
|
+
type SuggestedPostPaidMessage = ServiceMessage & MsgWith<"suggested_post_paid">;
|
|
108
|
+
type SuggestedPostRefundedMessage = ServiceMessage & MsgWith<"suggested_post_refunded">;
|
|
97
109
|
type NewChatMembersMessage = ServiceMessage & MsgWith<"new_chat_members">;
|
|
98
110
|
type LeftChatMemberMessage = ServiceMessage & MsgWith<"left_chat_member">;
|
|
99
111
|
type NewChatTitleMessage = ServiceMessage & MsgWith<"new_chat_title">;
|
|
@@ -183,6 +195,18 @@ export interface Message extends Message.MediaMessage {
|
|
|
183
195
|
checklist_tasks_done?: ChecklistTasksDone;
|
|
184
196
|
/** Service message: tasks were added to a checklist */
|
|
185
197
|
checklist_tasks_added?: ChecklistTasksAdded;
|
|
198
|
+
/** Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is a suggested post, then it can't be edited. */
|
|
199
|
+
suggested_post_info?: SuggestedPostInfo;
|
|
200
|
+
/** Service message: a suggested post was approved */
|
|
201
|
+
suggested_post_approved?: SuggestedPostApproved;
|
|
202
|
+
/** Service message: approval of a suggested post has failed */
|
|
203
|
+
suggested_post_approval_failed?: SuggestedPostApprovalFailed;
|
|
204
|
+
/** Service message: a suggested post was declined */
|
|
205
|
+
suggested_post_declined?: SuggestedPostDeclined;
|
|
206
|
+
/** Service message: payment for a suggested post was received */
|
|
207
|
+
suggested_post_paid?: SuggestedPostPaid;
|
|
208
|
+
/** Service message: payment for a suggested post was refunded */
|
|
209
|
+
suggested_post_refunded?: SuggestedPostRefunded;
|
|
186
210
|
/** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
|
|
187
211
|
new_chat_members?: User[];
|
|
188
212
|
/** A member was removed from the group, information about them (this member may be the bot itself) */
|
|
@@ -506,8 +530,10 @@ export interface ExternalReplyInfo {
|
|
|
506
530
|
export interface ReplyParameters {
|
|
507
531
|
/** Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified */
|
|
508
532
|
message_id: number;
|
|
509
|
-
/** If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account. */
|
|
533
|
+
/** If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account and messages from channel direct messages chats. */
|
|
510
534
|
chat_id?: number | string;
|
|
535
|
+
/** Identifier of the specific checklist task to be replied to */
|
|
536
|
+
checklist_task_id?: number;
|
|
511
537
|
/** Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic. Always True for messages sent on behalf of a business account. */
|
|
512
538
|
allow_sending_without_reply?: boolean;
|
|
513
539
|
/** Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn't found in the original message. */
|
|
@@ -1291,4 +1317,18 @@ export interface PreparedInlineMessage {
|
|
|
1291
1317
|
/** Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used */
|
|
1292
1318
|
expiration_date: number;
|
|
1293
1319
|
}
|
|
1320
|
+
/** Describes a topic of a direct messages chat. */
|
|
1321
|
+
export interface DirectMessagesTopic {
|
|
1322
|
+
/** Unique identifier of the topic */
|
|
1323
|
+
topic_id: number;
|
|
1324
|
+
/** Information about the user that created the topic. Currently, it is always present */
|
|
1325
|
+
user: User;
|
|
1326
|
+
}
|
|
1327
|
+
/** Contains parameters of a post that is being suggested by the bot. */
|
|
1328
|
+
export interface SuggestedPostParameters {
|
|
1329
|
+
/** Proposed price for the post. If the field is omitted, then the post is unpaid. */
|
|
1330
|
+
price?: SuggestedPostPrice;
|
|
1331
|
+
/** Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it. */
|
|
1332
|
+
send_date?: number;
|
|
1333
|
+
}
|
|
1294
1334
|
export {};
|
package/methods.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { InlineQueryResult, InlineQueryResultsButton } from "./inline.js";
|
|
|
3
3
|
import type { LanguageCode } from "./langs.js";
|
|
4
4
|
import type { AcceptedGiftTypes, BotCommand, BusinessConnection, ChatAdministratorRights, ChatFullInfo, ChatInviteLink, ChatMember, ChatMemberAdministrator, ChatMemberOwner, ChatPermissions, ForumTopic, UserChatBoosts, UserFromGetMe, UserProfilePhotos, WebhookInfo } from "./manage.js";
|
|
5
5
|
import type { ForceReply, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "./markup.js";
|
|
6
|
-
import type { File, GameHighScore, InputPollOption, LinkPreviewOptions, MaskPosition, Message, MessageEntity, MessageId, ParseMode, Poll, PreparedInlineMessage, ReactionType, ReplyParameters, SentWebAppMessage, Sticker, StickerSet, Story } from "./message.js";
|
|
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";
|
|
8
8
|
import type { Gifts, LabeledPrice, OwnedGifts, ShippingOption, StarAmount, StarTransactions } from "./payment.js";
|
|
9
9
|
import type { BotCommandScope, BotDescription, BotName, BotShortDescription, MenuButton } from "./settings.js";
|
|
@@ -83,6 +83,8 @@ export type ApiMethods<F> = {
|
|
|
83
83
|
chat_id: number | string;
|
|
84
84
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
85
85
|
message_thread_id?: number;
|
|
86
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
87
|
+
direct_messages_topic_id?: number;
|
|
86
88
|
/** Text of the message to be sent, 1-4096 characters after entities parsing */
|
|
87
89
|
text: string;
|
|
88
90
|
/** Mode for parsing entities in the message text. See formatting options for more details. */
|
|
@@ -97,6 +99,8 @@ export type ApiMethods<F> = {
|
|
|
97
99
|
protect_content?: boolean;
|
|
98
100
|
/** 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 */
|
|
99
101
|
allow_paid_broadcast?: boolean;
|
|
102
|
+
/** 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. */
|
|
103
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
100
104
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
101
105
|
message_effect_id?: string;
|
|
102
106
|
/** Description of the message to reply to */
|
|
@@ -112,10 +116,14 @@ export type ApiMethods<F> = {
|
|
|
112
116
|
chat_id: number | string;
|
|
113
117
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
114
118
|
message_thread_id?: number;
|
|
119
|
+
/** Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat */
|
|
120
|
+
direct_messages_topic_id?: number;
|
|
115
121
|
/** Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) */
|
|
116
122
|
from_chat_id: number | string;
|
|
117
123
|
/** New start timestamp for the copied video in the message */
|
|
118
124
|
video_start_timestamp?: number;
|
|
125
|
+
/** An object containing the parameters of the suggested post to send; for direct messages chats only */
|
|
126
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
119
127
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
120
128
|
disable_notification?: boolean;
|
|
121
129
|
/** Protects the contents of the forwarded message from forwarding and saving */
|
|
@@ -129,6 +137,8 @@ export type ApiMethods<F> = {
|
|
|
129
137
|
chat_id: number | string;
|
|
130
138
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
131
139
|
message_thread_id?: number;
|
|
140
|
+
/** Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat */
|
|
141
|
+
direct_messages_topic_id?: number;
|
|
132
142
|
/** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
|
|
133
143
|
from_chat_id: number | string;
|
|
134
144
|
/** A list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. */
|
|
@@ -144,6 +154,8 @@ export type ApiMethods<F> = {
|
|
|
144
154
|
chat_id: number | string;
|
|
145
155
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
146
156
|
message_thread_id?: number;
|
|
157
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
158
|
+
direct_messages_topic_id?: number;
|
|
147
159
|
/** Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) */
|
|
148
160
|
from_chat_id: number | string;
|
|
149
161
|
/** Message identifier in the chat specified in from_chat_id */
|
|
@@ -164,6 +176,8 @@ export type ApiMethods<F> = {
|
|
|
164
176
|
protect_content?: boolean;
|
|
165
177
|
/** 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 */
|
|
166
178
|
allow_paid_broadcast?: boolean;
|
|
179
|
+
/** 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. */
|
|
180
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
167
181
|
/** Description of the message to reply to */
|
|
168
182
|
reply_parameters?: ReplyParameters;
|
|
169
183
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
@@ -177,6 +191,8 @@ export type ApiMethods<F> = {
|
|
|
177
191
|
chat_id: number | string;
|
|
178
192
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
179
193
|
message_thread_id?: number;
|
|
194
|
+
/** Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat */
|
|
195
|
+
direct_messages_topic_id?: number;
|
|
180
196
|
/** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
|
|
181
197
|
from_chat_id: number | string;
|
|
182
198
|
/** A list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. */
|
|
@@ -196,6 +212,8 @@ export type ApiMethods<F> = {
|
|
|
196
212
|
chat_id: number | string;
|
|
197
213
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
198
214
|
message_thread_id?: number;
|
|
215
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
216
|
+
direct_messages_topic_id?: number;
|
|
199
217
|
/** Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. */
|
|
200
218
|
photo: F | string;
|
|
201
219
|
/** Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing */
|
|
@@ -214,6 +232,8 @@ export type ApiMethods<F> = {
|
|
|
214
232
|
protect_content?: boolean;
|
|
215
233
|
/** 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 */
|
|
216
234
|
allow_paid_broadcast?: boolean;
|
|
235
|
+
/** 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. */
|
|
236
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
217
237
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
218
238
|
message_effect_id?: string;
|
|
219
239
|
/** Description of the message to reply to */
|
|
@@ -233,6 +253,8 @@ export type ApiMethods<F> = {
|
|
|
233
253
|
chat_id: number | string;
|
|
234
254
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
235
255
|
message_thread_id?: number;
|
|
256
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
257
|
+
direct_messages_topic_id?: number;
|
|
236
258
|
/** Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. */
|
|
237
259
|
audio: F | string;
|
|
238
260
|
/** Audio caption, 0-1024 characters after entities parsing */
|
|
@@ -255,6 +277,8 @@ export type ApiMethods<F> = {
|
|
|
255
277
|
protect_content?: boolean;
|
|
256
278
|
/** 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 */
|
|
257
279
|
allow_paid_broadcast?: boolean;
|
|
280
|
+
/** 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. */
|
|
281
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
258
282
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
259
283
|
message_effect_id?: string;
|
|
260
284
|
/** Description of the message to reply to */
|
|
@@ -272,6 +296,8 @@ export type ApiMethods<F> = {
|
|
|
272
296
|
chat_id: number | string;
|
|
273
297
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
274
298
|
message_thread_id?: number;
|
|
299
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
300
|
+
direct_messages_topic_id?: number;
|
|
275
301
|
/** File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. */
|
|
276
302
|
document: F | string;
|
|
277
303
|
/** 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>. */
|
|
@@ -290,6 +316,8 @@ export type ApiMethods<F> = {
|
|
|
290
316
|
protect_content?: boolean;
|
|
291
317
|
/** 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 */
|
|
292
318
|
allow_paid_broadcast?: boolean;
|
|
319
|
+
/** 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. */
|
|
320
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
293
321
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
294
322
|
message_effect_id?: string;
|
|
295
323
|
/** Description of the message to reply to */
|
|
@@ -307,6 +335,8 @@ export type ApiMethods<F> = {
|
|
|
307
335
|
chat_id: number | string;
|
|
308
336
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
309
337
|
message_thread_id?: number;
|
|
338
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
339
|
+
direct_messages_topic_id?: number;
|
|
310
340
|
/** Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. */
|
|
311
341
|
video: F | string;
|
|
312
342
|
/** Duration of sent video in seconds */
|
|
@@ -339,6 +369,8 @@ export type ApiMethods<F> = {
|
|
|
339
369
|
protect_content?: boolean;
|
|
340
370
|
/** 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 */
|
|
341
371
|
allow_paid_broadcast?: boolean;
|
|
372
|
+
/** 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. */
|
|
373
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
342
374
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
343
375
|
message_effect_id?: string;
|
|
344
376
|
/** Description of the message to reply to */
|
|
@@ -356,6 +388,8 @@ export type ApiMethods<F> = {
|
|
|
356
388
|
chat_id: number | string;
|
|
357
389
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
358
390
|
message_thread_id?: number;
|
|
391
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
392
|
+
direct_messages_topic_id?: number;
|
|
359
393
|
/** Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. */
|
|
360
394
|
animation: F | string;
|
|
361
395
|
/** Duration of sent animation in seconds */
|
|
@@ -382,6 +416,8 @@ export type ApiMethods<F> = {
|
|
|
382
416
|
protect_content?: boolean;
|
|
383
417
|
/** 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 */
|
|
384
418
|
allow_paid_broadcast?: boolean;
|
|
419
|
+
/** 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. */
|
|
420
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
385
421
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
386
422
|
message_effect_id?: string;
|
|
387
423
|
/** Description of the message to reply to */
|
|
@@ -399,6 +435,8 @@ export type ApiMethods<F> = {
|
|
|
399
435
|
chat_id: number | string;
|
|
400
436
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
401
437
|
message_thread_id?: number;
|
|
438
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
439
|
+
direct_messages_topic_id?: number;
|
|
402
440
|
/** Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. */
|
|
403
441
|
voice: F | string;
|
|
404
442
|
/** Voice message caption, 0-1024 characters after entities parsing */
|
|
@@ -415,6 +453,8 @@ export type ApiMethods<F> = {
|
|
|
415
453
|
protect_content?: boolean;
|
|
416
454
|
/** 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 */
|
|
417
455
|
allow_paid_broadcast?: boolean;
|
|
456
|
+
/** 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. */
|
|
457
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
418
458
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
419
459
|
message_effect_id?: string;
|
|
420
460
|
/** Description of the message to reply to */
|
|
@@ -433,6 +473,8 @@ export type ApiMethods<F> = {
|
|
|
433
473
|
chat_id: number | string;
|
|
434
474
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
435
475
|
message_thread_id?: number;
|
|
476
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
477
|
+
direct_messages_topic_id?: number;
|
|
436
478
|
/** Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data.. Sending video notes by a URL is currently unsupported */
|
|
437
479
|
video_note: F | string;
|
|
438
480
|
/** Duration of sent video in seconds */
|
|
@@ -447,6 +489,8 @@ export type ApiMethods<F> = {
|
|
|
447
489
|
protect_content?: boolean;
|
|
448
490
|
/** 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 */
|
|
449
491
|
allow_paid_broadcast?: boolean;
|
|
492
|
+
/** 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. */
|
|
493
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
450
494
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
451
495
|
message_effect_id?: string;
|
|
452
496
|
/** Description of the message to reply to */
|
|
@@ -464,6 +508,8 @@ export type ApiMethods<F> = {
|
|
|
464
508
|
chat_id: number | string;
|
|
465
509
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
466
510
|
message_thread_id?: number;
|
|
511
|
+
/** Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat */
|
|
512
|
+
direct_messages_topic_id?: number;
|
|
467
513
|
/** An array describing messages to be sent, must include 2-10 items */
|
|
468
514
|
media: ReadonlyArray<InputMediaAudio<F> | InputMediaDocument<F> | InputMediaPhoto<F> | InputMediaVideo<F>>;
|
|
469
515
|
/** Sends the messages silently. Users will receive a notification with no sound. */
|
|
@@ -487,6 +533,8 @@ export type ApiMethods<F> = {
|
|
|
487
533
|
chat_id: number | string;
|
|
488
534
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
489
535
|
message_thread_id?: number;
|
|
536
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
537
|
+
direct_messages_topic_id?: number;
|
|
490
538
|
/** Latitude of the location */
|
|
491
539
|
latitude: number;
|
|
492
540
|
/** Longitude of the location */
|
|
@@ -505,6 +553,8 @@ export type ApiMethods<F> = {
|
|
|
505
553
|
protect_content?: boolean;
|
|
506
554
|
/** 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 */
|
|
507
555
|
allow_paid_broadcast?: boolean;
|
|
556
|
+
/** 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. */
|
|
557
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
508
558
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
509
559
|
message_effect_id?: string;
|
|
510
560
|
/** Description of the message to reply to */
|
|
@@ -558,6 +608,8 @@ export type ApiMethods<F> = {
|
|
|
558
608
|
business_connection_id?: string;
|
|
559
609
|
/** 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. */
|
|
560
610
|
chat_id: number | string;
|
|
611
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
612
|
+
direct_messages_topic_id?: number;
|
|
561
613
|
/** The number of Telegram Stars that must be paid to buy access to the media; 1-2500 */
|
|
562
614
|
star_count: number;
|
|
563
615
|
/** An array describing the media to be sent; up to 10 items */
|
|
@@ -578,6 +630,8 @@ export type ApiMethods<F> = {
|
|
|
578
630
|
protect_content?: boolean;
|
|
579
631
|
/** 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 */
|
|
580
632
|
allow_paid_broadcast?: boolean;
|
|
633
|
+
/** 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. */
|
|
634
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
581
635
|
/** Description of the message to reply to */
|
|
582
636
|
reply_parameters?: ReplyParameters;
|
|
583
637
|
/** 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 */
|
|
@@ -591,6 +645,8 @@ export type ApiMethods<F> = {
|
|
|
591
645
|
chat_id: number | string;
|
|
592
646
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
593
647
|
message_thread_id?: number;
|
|
648
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
649
|
+
direct_messages_topic_id?: number;
|
|
594
650
|
/** Latitude of the venue */
|
|
595
651
|
latitude: number;
|
|
596
652
|
/** Longitude of the venue */
|
|
@@ -613,6 +669,8 @@ export type ApiMethods<F> = {
|
|
|
613
669
|
protect_content?: boolean;
|
|
614
670
|
/** 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 */
|
|
615
671
|
allow_paid_broadcast?: boolean;
|
|
672
|
+
/** 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. */
|
|
673
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
616
674
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
617
675
|
message_effect_id?: string;
|
|
618
676
|
/** Description of the message to reply to */
|
|
@@ -630,6 +688,8 @@ export type ApiMethods<F> = {
|
|
|
630
688
|
chat_id: number | string;
|
|
631
689
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
632
690
|
message_thread_id?: number;
|
|
691
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
692
|
+
direct_messages_topic_id?: number;
|
|
633
693
|
/** Contact's phone number */
|
|
634
694
|
phone_number: string;
|
|
635
695
|
/** Contact's first name */
|
|
@@ -644,6 +704,8 @@ export type ApiMethods<F> = {
|
|
|
644
704
|
protect_content?: boolean;
|
|
645
705
|
/** 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 */
|
|
646
706
|
allow_paid_broadcast?: boolean;
|
|
707
|
+
/** 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. */
|
|
708
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
647
709
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
648
710
|
message_effect_id?: string;
|
|
649
711
|
/** Description of the message to reply to */
|
|
@@ -657,7 +719,7 @@ export type ApiMethods<F> = {
|
|
|
657
719
|
sendPoll(args: {
|
|
658
720
|
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
659
721
|
business_connection_id?: string;
|
|
660
|
-
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
722
|
+
/** 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. */
|
|
661
723
|
chat_id: number | string;
|
|
662
724
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
663
725
|
message_thread_id?: number;
|
|
@@ -744,6 +806,8 @@ export type ApiMethods<F> = {
|
|
|
744
806
|
chat_id: number | string;
|
|
745
807
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
746
808
|
message_thread_id?: number;
|
|
809
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
810
|
+
direct_messages_topic_id?: number;
|
|
747
811
|
/** Emoji on which the dice throw animation is based. Currently, must be one of "🎲", "🎯", "🏀", "⚽", "🎳", or "🎰". Dice can have values 1-6 for "🎲", "🎯" and "🎳", values 1-5 for "🏀" and "⚽", and values 1-64 for "🎰". Defaults to "🎲" */
|
|
748
812
|
emoji?: (string & Record<never, never>) | "🎲" | "🎯" | "🏀" | "⚽" | "🎳" | "🎰";
|
|
749
813
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
@@ -752,6 +816,8 @@ export type ApiMethods<F> = {
|
|
|
752
816
|
protect_content?: boolean;
|
|
753
817
|
/** 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 */
|
|
754
818
|
allow_paid_broadcast?: boolean;
|
|
819
|
+
/** 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. */
|
|
820
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
755
821
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
756
822
|
message_effect_id?: string;
|
|
757
823
|
/** Description of the message to reply to */
|
|
@@ -769,7 +835,7 @@ export type ApiMethods<F> = {
|
|
|
769
835
|
sendChatAction(args: {
|
|
770
836
|
/** Unique identifier of the business connection on behalf of which the action will be sent */
|
|
771
837
|
business_connection_id?: string;
|
|
772
|
-
/** Unique identifier for the target chat or username of the target
|
|
838
|
+
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel chats and channel direct messages chats aren't supported. */
|
|
773
839
|
chat_id: number | string;
|
|
774
840
|
/** Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes. */
|
|
775
841
|
action: "typing" | "upload_photo" | "record_video" | "upload_video" | "record_voice" | "upload_voice" | "upload_document" | "choose_sticker" | "find_location" | "record_video_note" | "upload_video_note";
|
|
@@ -884,6 +950,8 @@ export type ApiMethods<F> = {
|
|
|
884
950
|
can_pin_messages?: boolean;
|
|
885
951
|
/** True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
|
|
886
952
|
can_manage_topics?: boolean;
|
|
953
|
+
/** Pass True if the administrator can manage direct messages within the channel and decline suggested posts; for channels only */
|
|
954
|
+
can_manage_direct_messages?: boolean;
|
|
887
955
|
}): true;
|
|
888
956
|
/** Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success. */
|
|
889
957
|
setChatAdministratorCustomTitle(args: {
|
|
@@ -993,6 +1061,24 @@ export type ApiMethods<F> = {
|
|
|
993
1061
|
/** Unique identifier of the target user */
|
|
994
1062
|
user_id: number;
|
|
995
1063
|
}): true;
|
|
1064
|
+
/** Use this method to approve a suggested post in a direct messages chat. The bot must have the 'can_post_messages' administrator right in the corresponding channel chat. Returns True on success. */
|
|
1065
|
+
approveSuggestedPost(args: {
|
|
1066
|
+
/** Unique identifier for the target direct messages chat */
|
|
1067
|
+
chat_id: number;
|
|
1068
|
+
/** Identifier of a suggested post message to approve */
|
|
1069
|
+
message_id: number;
|
|
1070
|
+
/** Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created */
|
|
1071
|
+
send_date?: number;
|
|
1072
|
+
}): true;
|
|
1073
|
+
/** Use this method to decline a suggested post in a direct messages chat. The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat. Returns True on success. */
|
|
1074
|
+
declineSuggestedPost(args: {
|
|
1075
|
+
/** Unique identifier for the target direct messages chat */
|
|
1076
|
+
chat_id: number;
|
|
1077
|
+
/** Identifier of a suggested post message to decline */
|
|
1078
|
+
message_id: number;
|
|
1079
|
+
/** Comment for the creator of the suggested post */
|
|
1080
|
+
comment?: string;
|
|
1081
|
+
}): true;
|
|
996
1082
|
/** Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. */
|
|
997
1083
|
setChatPhoto(args: {
|
|
998
1084
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
@@ -1019,7 +1105,7 @@ export type ApiMethods<F> = {
|
|
|
1019
1105
|
/** New chat description, 0-255 characters */
|
|
1020
1106
|
description?: string;
|
|
1021
1107
|
}): true;
|
|
1022
|
-
/** Use this method to add a message to the list of pinned messages in a chat.
|
|
1108
|
+
/** Use this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to pin messages in groups and channels respectively. Returns True on success. */
|
|
1023
1109
|
pinChatMessage(args: {
|
|
1024
1110
|
/** Unique identifier of the business connection on behalf of which the message will be pinned */
|
|
1025
1111
|
business_connection_id?: string;
|
|
@@ -1030,7 +1116,7 @@ export type ApiMethods<F> = {
|
|
|
1030
1116
|
/** Pass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats. */
|
|
1031
1117
|
disable_notification?: boolean;
|
|
1032
1118
|
}): true;
|
|
1033
|
-
/** Use this method to remove a message from the list of pinned messages in a chat.
|
|
1119
|
+
/** Use this method to remove a message from the list of pinned messages in a chat. In private chats and channel direct messages chats, all messages can be unpinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin messages in groups and channels respectively. Returns True on success. */
|
|
1034
1120
|
unpinChatMessage(args: {
|
|
1035
1121
|
/** Unique identifier of the business connection on behalf of which the message will be unpinned */
|
|
1036
1122
|
business_connection_id?: string;
|
|
@@ -1039,14 +1125,14 @@ export type ApiMethods<F> = {
|
|
|
1039
1125
|
/** Identifier of the message to unpin. Required if business_connection_id is specified. If not specified, the most recent pinned message (by sending date) will be unpinned. */
|
|
1040
1126
|
message_id?: number;
|
|
1041
1127
|
}): true;
|
|
1042
|
-
/** Use this method to clear the list of pinned messages in a chat.
|
|
1128
|
+
/** Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns True on success. */
|
|
1043
1129
|
unpinAllChatMessages(args: {
|
|
1044
1130
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1045
1131
|
chat_id: number | string;
|
|
1046
1132
|
}): true;
|
|
1047
1133
|
/** Use this method for your bot to leave a group, supergroup or channel. Returns True on success. */
|
|
1048
1134
|
leaveChat(args: {
|
|
1049
|
-
/** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
|
|
1135
|
+
/** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername). Channel direct messages chats aren't supported; leave the corresponding channel instead. */
|
|
1050
1136
|
chat_id: number | string;
|
|
1051
1137
|
}): true;
|
|
1052
1138
|
/** Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success. */
|
|
@@ -1373,7 +1459,8 @@ export type ApiMethods<F> = {
|
|
|
1373
1459
|
- Bots can delete incoming messages in private chats.
|
|
1374
1460
|
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
|
|
1375
1461
|
- If the bot is an administrator of a group, it can delete any message there.
|
|
1376
|
-
- If the bot has can_delete_messages
|
|
1462
|
+
- If the bot has can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.
|
|
1463
|
+
- If the bot has can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat.
|
|
1377
1464
|
Returns True on success. */
|
|
1378
1465
|
deleteMessage(args: {
|
|
1379
1466
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
@@ -1558,6 +1645,8 @@ export type ApiMethods<F> = {
|
|
|
1558
1645
|
chat_id: number | string;
|
|
1559
1646
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
1560
1647
|
message_thread_id?: number;
|
|
1648
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
1649
|
+
direct_messages_topic_id?: number;
|
|
1561
1650
|
/** Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. Video and animated stickers can't be sent via an HTTP URL. */
|
|
1562
1651
|
sticker: F | string;
|
|
1563
1652
|
/** Emoji associated with the sticker; only for just uploaded stickers */
|
|
@@ -1568,6 +1657,8 @@ export type ApiMethods<F> = {
|
|
|
1568
1657
|
protect_content?: boolean;
|
|
1569
1658
|
/** 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 */
|
|
1570
1659
|
allow_paid_broadcast?: boolean;
|
|
1660
|
+
/** 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. */
|
|
1661
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
1571
1662
|
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
1572
1663
|
message_effect_id?: string;
|
|
1573
1664
|
/** Description of the message to reply to */
|
|
@@ -1774,6 +1865,8 @@ export type ApiMethods<F> = {
|
|
|
1774
1865
|
chat_id: number | string;
|
|
1775
1866
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
1776
1867
|
message_thread_id?: number;
|
|
1868
|
+
/** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
|
|
1869
|
+
direct_messages_topic_id?: number;
|
|
1777
1870
|
/** Product name, 1-32 characters */
|
|
1778
1871
|
title: string;
|
|
1779
1872
|
/** Product description, 1-255 characters */
|
|
@@ -1816,6 +1909,8 @@ export type ApiMethods<F> = {
|
|
|
1816
1909
|
send_email_to_provider?: boolean;
|
|
1817
1910
|
/** Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. */
|
|
1818
1911
|
is_flexible?: boolean;
|
|
1912
|
+
/** 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. */
|
|
1913
|
+
suggested_post_parameters?: SuggestedPostParameters;
|
|
1819
1914
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
1820
1915
|
disable_notification?: boolean;
|
|
1821
1916
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
@@ -1930,7 +2025,7 @@ export type ApiMethods<F> = {
|
|
|
1930
2025
|
}): true;
|
|
1931
2026
|
/** Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success. */
|
|
1932
2027
|
verifyChat(args: {
|
|
1933
|
-
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
2028
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername). Channel direct messages chats can't be verified. */
|
|
1934
2029
|
chat_id: number | string;
|
|
1935
2030
|
/** Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. */
|
|
1936
2031
|
custom_description?: string;
|
|
@@ -1967,7 +2062,7 @@ export type ApiMethods<F> = {
|
|
|
1967
2062
|
sendGame(args: {
|
|
1968
2063
|
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
1969
2064
|
business_connection_id?: string;
|
|
1970
|
-
/** Unique identifier for the target chat */
|
|
2065
|
+
/** Unique identifier for the target chat. Games can't be sent to channel direct messages chats and channel chats. */
|
|
1971
2066
|
chat_id: number;
|
|
1972
2067
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
1973
2068
|
message_thread_id?: number;
|
package/package.json
CHANGED
package/payment.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Chat, User } from "./manage.js";
|
|
2
|
-
import type { MessageEntity, PaidMedia, Sticker } from "./message.js";
|
|
2
|
+
import type { Message, MessageEntity, PaidMedia, Sticker } from "./message.js";
|
|
3
3
|
/** This object represents a portion of the price for goods or services. */
|
|
4
4
|
export interface LabeledPrice {
|
|
5
5
|
/** Portion label */
|
|
@@ -263,6 +263,8 @@ export interface PaidMediaPurchased {
|
|
|
263
263
|
export interface Gift {
|
|
264
264
|
/** Unique identifier of the gift */
|
|
265
265
|
id: string;
|
|
266
|
+
/** Information about the chat that published the gift */
|
|
267
|
+
publisher_chat?: Chat;
|
|
266
268
|
/** The sticker that represents the gift */
|
|
267
269
|
sticker: Sticker;
|
|
268
270
|
/** The number of Telegram Stars that must be paid to send the sticker */
|
|
@@ -323,6 +325,8 @@ export interface UniqueGift {
|
|
|
323
325
|
base_name: string;
|
|
324
326
|
/** Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas */
|
|
325
327
|
name: string;
|
|
328
|
+
/** Information about the chat that published the gift */
|
|
329
|
+
publisher_chat?: Chat;
|
|
326
330
|
/** Unique number of the upgraded gift among gifts upgraded from the same regular gift */
|
|
327
331
|
number: number;
|
|
328
332
|
/** Model of the gift */
|
|
@@ -442,3 +446,60 @@ export interface OwnedGifts {
|
|
|
442
446
|
/** Offset for the next request. If empty, then there are no more results */
|
|
443
447
|
next_offset?: string;
|
|
444
448
|
}
|
|
449
|
+
/** Desribes price of a suggested post. */
|
|
450
|
+
export interface SuggestedPostPrice {
|
|
451
|
+
/** Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins */
|
|
452
|
+
currency: "XTR" | "TON";
|
|
453
|
+
/** The amount of the currency that will be paid for the post in the smallest units of the currency, i.e. Telegram Stars or nanotoncoins. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanotoncoins must be between 10000000 and 10000000000000. */
|
|
454
|
+
amount: number;
|
|
455
|
+
}
|
|
456
|
+
/** Contains information about a suggested post. */
|
|
457
|
+
export interface SuggestedPostInfo {
|
|
458
|
+
/** State of the suggested post. Currently, it can be one of “pending”, “approved”, “declined”. */
|
|
459
|
+
state: "pending" | "approved" | "declined";
|
|
460
|
+
/** Proposed price of the post. If the field is omitted, then the post is unpaid. */
|
|
461
|
+
price?: SuggestedPostPrice;
|
|
462
|
+
/** Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it. */
|
|
463
|
+
send_date?: number;
|
|
464
|
+
}
|
|
465
|
+
/** Describes a service message about the approval of a suggested post. */
|
|
466
|
+
export interface SuggestedPostApproved {
|
|
467
|
+
/** Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
|
|
468
|
+
suggested_post_message?: Message;
|
|
469
|
+
/** Amount paid for the post */
|
|
470
|
+
price?: SuggestedPostPrice;
|
|
471
|
+
/** Date when the post will be published */
|
|
472
|
+
send_date: number;
|
|
473
|
+
}
|
|
474
|
+
/** Describes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval. */
|
|
475
|
+
export interface SuggestedPostApprovalFailed {
|
|
476
|
+
/** Message containing the suggested post whose approval has failed. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
|
|
477
|
+
suggested_post_message?: Message;
|
|
478
|
+
/** Expected price of the post */
|
|
479
|
+
price: SuggestedPostPrice;
|
|
480
|
+
}
|
|
481
|
+
/** Describes a service message about the rejection of a suggested post. */
|
|
482
|
+
export interface SuggestedPostDeclined {
|
|
483
|
+
/** Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
|
|
484
|
+
suggested_post_message?: Message;
|
|
485
|
+
/** Comment with which the post was declined */
|
|
486
|
+
comment?: string;
|
|
487
|
+
}
|
|
488
|
+
/** Describes a service message about a successful payment for a suggested post. */
|
|
489
|
+
export interface SuggestedPostPaid {
|
|
490
|
+
/** Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
|
|
491
|
+
suggested_post_message?: Message;
|
|
492
|
+
/** Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins */
|
|
493
|
+
currency: string;
|
|
494
|
+
/** The amount of the currency that was received by the channel in nanotoncoins; for payments in toncoins only */
|
|
495
|
+
amount?: number;
|
|
496
|
+
/** The amount of Telegram Stars that was received by the channel; for payments in Telegram Stars only */
|
|
497
|
+
star_amount?: StarAmount;
|
|
498
|
+
}
|
|
499
|
+
/** Describes a service message about a payment refund for a suggested post. */
|
|
500
|
+
export interface SuggestedPostRefunded {
|
|
501
|
+
/** Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
|
|
502
|
+
suggested_post_message?: Message;
|
|
503
|
+
/** Reason for the refund. Currently, one of “post_deleted” if the post was deleted within 24 hours of being posted or removed from scheduled messages without being posted, or “payment_refunded” if the payer refunded their payment. */
|
|
504
|
+
reason: string;
|
|
505
|
+
}
|
package/settings.d.ts
CHANGED
|
@@ -99,21 +99,21 @@ export interface BotCommandScopeAllChatAdministrators {
|
|
|
99
99
|
export interface BotCommandScopeChat {
|
|
100
100
|
/** Scope type, must be chat */
|
|
101
101
|
type: "chat";
|
|
102
|
-
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
|
|
102
|
+
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported. */
|
|
103
103
|
chat_id: number | string;
|
|
104
104
|
}
|
|
105
105
|
/** Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat. */
|
|
106
106
|
export interface BotCommandScopeChatAdministrators {
|
|
107
107
|
/** Scope type, must be chat_administrators */
|
|
108
108
|
type: "chat_administrators";
|
|
109
|
-
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
|
|
109
|
+
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported. */
|
|
110
110
|
chat_id: number | string;
|
|
111
111
|
}
|
|
112
112
|
/** Represents the scope of bot commands, covering a specific member of a group or supergroup chat. */
|
|
113
113
|
export interface BotCommandScopeChatMember {
|
|
114
114
|
/** Scope type, must be chat_member */
|
|
115
115
|
type: "chat_member";
|
|
116
|
-
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
|
|
116
|
+
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported. */
|
|
117
117
|
chat_id: number | string;
|
|
118
118
|
/** Unique identifier of the target user */
|
|
119
119
|
user_id: number;
|