Skip to content

Commit 9f915d9

Browse files
authored
Merge pull request #12 from telegraf/feat/api-9.2
2 parents 7f358ea + ac16232 commit 9f915d9

6 files changed

Lines changed: 636 additions & 240 deletions

File tree

inline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ export interface InputInvoiceMessageContent {
683683
provider_token?: string;
684684
/** Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. */
685685
currency: string;
686-
/** Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. */
686+
/** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. */
687687
prices: LabeledPrice[];
688688
/** Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. */
689689
max_tip_amount?: number;

manage.ts

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ export declare namespace Chat {
103103
title: string;
104104
/** True, if the supergroup chat is a forum (has topics enabled) */
105105
is_forum?: true;
106+
/** True, if the chat is the direct messages chat of a channel */
107+
is_direct_messages?: true;
106108
}
107109

108110
/** Internal type representing channel chats. */
@@ -226,6 +228,8 @@ declare namespace ChatFullInfo {
226228
photo?: ChatPhoto;
227229
/** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
228230
active_usernames?: string[];
231+
/** Information about the corresponding channel chat; for direct messages chats only */
232+
parent_chat?: Chat.ChannelChat;
229233
/** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed */
230234
available_reactions?: ReactionType[];
231235
/** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
@@ -319,6 +323,40 @@ export type ChatFullInfo =
319323
| ChatFullInfo.SupergroupChat
320324
| ChatFullInfo.ChannelChat;
321325

326+
/** Describes the price of a suggested post. */
327+
export interface SuggestedPostPrice {
328+
/** Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins */
329+
currency: string;
330+
/** 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. */
331+
amount: number;
332+
}
333+
334+
/** Contains information about a suggested post. */
335+
export interface SuggestedPostInfo {
336+
/** State of the suggested post. Currently, it can be one of “pending”, “approved”, “declined”. */
337+
state: "pending" | "approved" | "declined";
338+
/** Proposed price of the post. If the field is omitted, then the post is unpaid. */
339+
price?: SuggestedPostPrice;
340+
/** 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. */
341+
send_date?: number;
342+
}
343+
344+
/** Contains parameters of a post that is being suggested by the bot. */
345+
export interface SuggestedPostParameters {
346+
/** Proposed price for the post. If the field is omitted, then the post is unpaid. */
347+
price?: SuggestedPostPrice;
348+
/** Proposed send date of the post. If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future. 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. */
349+
send_date?: number;
350+
}
351+
352+
/** Describes a topic of a direct messages chat. */
353+
export interface DirectMessagesTopic {
354+
/** Unique identifier of the topic */
355+
topic_id: number;
356+
/** Information about the user that created the topic. Currently, it is always present */
357+
user: User;
358+
}
359+
322360
/** This object represent a user's profile pictures. */
323361
export interface UserProfilePhotos {
324362
/** Total number of profile pictures the target user has */
@@ -369,7 +407,7 @@ export interface ChatInviteLink {
369407
export interface ChatAdministratorRights {
370408
/** True, if the user's presence in the chat is hidden */
371409
is_anonymous: boolean;
372-
/** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege. */
410+
/** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. */
373411
can_manage_chat: boolean;
374412
/** True, if the administrator can delete messages of other users */
375413
can_delete_messages: boolean;
@@ -389,14 +427,16 @@ export interface ChatAdministratorRights {
389427
can_edit_stories: boolean;
390428
/** True, if the administrator can delete stories posted by other users */
391429
can_delete_stories: boolean;
392-
/** True, if the administrator can post messages in the channel, or access channel statistics; for channels only */
430+
/** True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */
393431
can_post_messages: boolean;
394432
/** True, if the administrator can edit messages of other users and can pin messages; for channels only */
395433
can_edit_messages: boolean;
396434
/** True, if the user is allowed to pin messages; for groups and supergroups only */
397435
can_pin_messages: boolean;
398436
/** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
399437
can_manage_topics: boolean;
438+
/** True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
439+
can_manage_direct_messages: boolean;
400440
}
401441

402442
/** This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
@@ -437,7 +477,7 @@ export interface ChatMemberAdministrator extends AbstractChatMember {
437477
can_be_edited: boolean;
438478
/** True, if the user's presence in the chat is hidden */
439479
is_anonymous: boolean;
440-
/** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege. */
480+
/** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. */
441481
can_manage_chat: boolean;
442482
/** True, if the administrator can delete messages of other users */
443483
can_delete_messages: boolean;
@@ -457,14 +497,16 @@ export interface ChatMemberAdministrator extends AbstractChatMember {
457497
can_edit_stories: boolean;
458498
/** True, if the administrator can delete stories posted by other users */
459499
can_delete_stories: boolean;
460-
/** True, if the administrator can post messages in the channel, or access channel statistics; for channels only */
500+
/** True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */
461501
can_post_messages: boolean;
462502
/** True, if the administrator can edit messages of other users and can pin messages; for channels only */
463503
can_edit_messages: boolean;
464504
/** True, if the user is allowed to pin messages; for groups and supergroups only */
465505
can_pin_messages: boolean;
466506
/** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
467507
can_manage_topics: boolean;
508+
/** True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
509+
can_manage_direct_messages: boolean;
468510
/** Custom title for this user */
469511
custom_title?: string;
470512
}
@@ -495,7 +537,7 @@ export interface ChatMemberRestricted extends AbstractChatMember {
495537
can_send_video_notes: boolean;
496538
/** True, if the user is allowed to send voice notes */
497539
can_send_voice_notes: boolean;
498-
/** True, if the user is allowed to send polls */
540+
/** True, if the user is allowed to send polls and checklists */
499541
can_send_polls: boolean;
500542
/** True, if the user is allowed to send animations, games, stickers and use inline bots */
501543
can_send_other_messages: boolean;
@@ -577,7 +619,7 @@ export interface ChatPermissions {
577619
can_send_video_notes?: boolean;
578620
/** True, if the user is allowed to send voice notes */
579621
can_send_voice_notes?: boolean;
580-
/** True, if the user is allowed to send polls */
622+
/** True, if the user is allowed to send polls and checklists */
581623
can_send_polls?: boolean;
582624
/** True, if the user is allowed to send animations, games, stickers and use inline bots */
583625
can_send_other_messages?: boolean;
@@ -756,7 +798,7 @@ export interface AbstractReactionType {
756798
}
757799

758800
// deno-fmt-ignore
759-
export type TelegramEmoji = "👍" | "👎" | "" | "🔥" | "🥰" | "👏" | "😁" | "🤔" | "🤯" | "😱" | "🤬" | "😢" | "🎉" | "🤩" | "🤮" | "💩" | "🙏" | "👌" | "🕊" | "🤡" | "🥱" | "🥴" | "😍" | "🐳" | "❤‍🔥" | "🌚" | "🌭" | "💯" | "🤣" | "⚡" | "🍌" | "🏆" | "💔" | "🤨" | "😐" | "🍓" | "🍾" | "💋" | "🖕" | "😈" | "😴" | "😭" | "🤓" | "👻" | "👨‍💻" | "👀" | "🎃" | "🙈" | "😇" | "😨" | "🤝" | "✍" | "🤗" | "🫡" | "🎅" | "🎄" | "☃" | "💅" | "🤪" | "🗿" | "🆒" | "💘" | "🙉" | "🦄" | "😘" | "💊" | "🙊" | "😎" | "👾" | "🤷‍♂" | "🤷" | "🤷‍♀" | "😡";
801+
export type TelegramEmoji = "" | "👍" | "👎" | "🔥" | "🥰" | "👏" | "😁" | "🤔" | "🤯" | "😱" | "🤬" | "😢" | "🎉" | "🤩" | "🤮" | "💩" | "🙏" | "👌" | "🕊" | "🤡" | "🥱" | "🥴" | "😍" | "🐳" | "❤‍🔥" | "🌚" | "🌭" | "💯" | "🤣" | "⚡" | "🍌" | "🏆" | "💔" | "🤨" | "😐" | "🍓" | "🍾" | "💋" | "🖕" | "😈" | "😴" | "😭" | "🤓" | "👻" | "👨‍💻" | "👀" | "🎃" | "🙈" | "😇" | "😨" | "🤝" | "✍" | "🤗" | "🫡" | "🎅" | "🎄" | "☃" | "💅" | "🤪" | "🗿" | "🆒" | "💘" | "🙉" | "🦄" | "😘" | "💊" | "🙊" | "😎" | "👾" | "🤷‍♂" | "🤷" | "🤷‍♀" | "😡";
760802

761803
/** The reaction is based on an emoji. */
762804
export interface ReactionTypeEmoji extends AbstractReactionType {
@@ -1029,6 +1071,8 @@ export interface Gift {
10291071
total_count?: number;
10301072
/** The number of remaining gifts of this type that can be sent; for limited gifts only */
10311073
remaining_count?: number;
1074+
/** Information about the chat that published the gift */
1075+
publisher_chat?: Chat;
10321076
}
10331077

10341078
/** This object represent a list of gifts. */
@@ -1093,6 +1137,8 @@ export interface UniqueGift {
10931137
symbol: UniqueGiftSymbol;
10941138
/** Backdrop of the gift */
10951139
backdrop: UniqueGiftBackdrop;
1140+
/** Information about the chat that published the gift */
1141+
publisher_chat?: Chat;
10961142
}
10971143

10981144
/** This object describes a gift received and owned by a user or a chat. Currently, it can be one of
@@ -1148,6 +1194,8 @@ export interface OwnedGiftUnique {
11481194
can_be_transferred?: boolean;
11491195
/** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
11501196
transfer_star_count?: number;
1197+
/** Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now */
1198+
next_transfer_date?: number;
11511199
}
11521200

11531201
/** Contains the list of gifts received and owned by a user or a chat. */

markup.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ export declare namespace InlineKeyboardButton {
2929
login_url: LoginUrl;
3030
}
3131
export interface SwitchInlineButton extends AbstractInlineKeyboardButton {
32-
/** 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. */
32+
/** 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. */
3333
switch_inline_query: string;
3434
}
3535
export interface SwitchInlineCurrentChatButton
3636
extends AbstractInlineKeyboardButton {
3737
/** 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.
3838
39-
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 on behalf of a Telegram Business account. */
39+
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 for messages sent in channel direct messages chats and on behalf of a Telegram Business account. */
4040
switch_inline_query_current_chat: string;
4141
}
4242
export interface SwitchInlineChosenChatButton
4343
extends AbstractInlineKeyboardButton {
44-
/** 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. */
44+
/** 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. */
4545
switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat;
4646
}
4747
export interface CopyTextButton extends AbstractInlineKeyboardButton {

0 commit comments

Comments
 (0)