@tgify/types 9.2.2 → 9.2.4
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/markup.d.ts +25 -13
- package/methods.d.ts +1 -22
- package/package.json +1 -1
package/markup.d.ts
CHANGED
|
@@ -6,51 +6,55 @@ export interface InlineKeyboardMarkup {
|
|
|
6
6
|
inline_keyboard: InlineKeyboardButton[][];
|
|
7
7
|
}
|
|
8
8
|
export declare namespace InlineKeyboardButton {
|
|
9
|
-
interface
|
|
9
|
+
interface AbstractInlineKeyboard {
|
|
10
10
|
/** Label text on the button */
|
|
11
11
|
text: string;
|
|
12
|
+
/** The text to be copied to the clipboard; 1-256 characters */
|
|
13
|
+
style?: 'primary' | 'success' | 'danger';
|
|
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
|
+
icon_custom_emoji_id?: string;
|
|
12
16
|
}
|
|
13
|
-
interface
|
|
17
|
+
interface Url extends AbstractInlineKeyboard {
|
|
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. */
|
|
15
19
|
url: string;
|
|
16
20
|
}
|
|
17
|
-
interface
|
|
21
|
+
interface Callback extends AbstractInlineKeyboard {
|
|
18
22
|
/** Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes */
|
|
19
23
|
callback_data: string;
|
|
20
24
|
}
|
|
21
|
-
interface
|
|
25
|
+
interface WebApp extends AbstractInlineKeyboard {
|
|
22
26
|
/** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account. */
|
|
23
27
|
web_app: WebAppInfo;
|
|
24
28
|
}
|
|
25
|
-
interface
|
|
29
|
+
interface Login extends AbstractInlineKeyboard {
|
|
26
30
|
/** An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. */
|
|
27
31
|
login_url: LoginUrl;
|
|
28
32
|
}
|
|
29
|
-
interface
|
|
33
|
+
interface SwitchInline extends AbstractInlineKeyboard {
|
|
30
34
|
/** 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
35
|
switch_inline_query: string;
|
|
32
36
|
}
|
|
33
|
-
interface
|
|
37
|
+
interface SwitchInlineCurrentChat extends AbstractInlineKeyboard {
|
|
34
38
|
/** 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
39
|
|
|
36
40
|
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. */
|
|
37
41
|
switch_inline_query_current_chat: string;
|
|
38
42
|
}
|
|
39
|
-
interface
|
|
43
|
+
interface SwitchInlineChosenChat extends AbstractInlineKeyboard {
|
|
40
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. */
|
|
41
45
|
switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat;
|
|
42
46
|
}
|
|
43
|
-
interface
|
|
47
|
+
interface CopyText extends AbstractInlineKeyboard {
|
|
44
48
|
/** Description of the button that copies the specified text to the clipboard. */
|
|
45
49
|
copy_text: CopyTextButton;
|
|
46
50
|
}
|
|
47
|
-
interface
|
|
51
|
+
interface Game extends AbstractInlineKeyboard {
|
|
48
52
|
/** Description of the game that will be launched when the user presses the button.
|
|
49
53
|
|
|
50
54
|
NOTE: This type of button must always be the first button in the first row. */
|
|
51
55
|
callback_game: CallbackGame;
|
|
52
56
|
}
|
|
53
|
-
interface
|
|
57
|
+
interface Pay extends AbstractInlineKeyboard {
|
|
54
58
|
/** Specify True, to send a Pay button.
|
|
55
59
|
|
|
56
60
|
NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */
|
|
@@ -58,7 +62,7 @@ export declare namespace InlineKeyboardButton {
|
|
|
58
62
|
}
|
|
59
63
|
}
|
|
60
64
|
/** This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button. */
|
|
61
|
-
export type InlineKeyboardButton = InlineKeyboardButton.
|
|
65
|
+
export type InlineKeyboardButton = InlineKeyboardButton.Callback | InlineKeyboardButton.Game | InlineKeyboardButton.Login | InlineKeyboardButton.Pay | InlineKeyboardButton.SwitchInline | InlineKeyboardButton.SwitchInlineCurrentChat | InlineKeyboardButton.SwitchInlineChosenChat | InlineKeyboardButton.Url | InlineKeyboardButton.WebApp;
|
|
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. */
|
|
64
68
|
export interface LoginUrl {
|
|
@@ -143,6 +147,14 @@ export declare namespace KeyboardButton {
|
|
|
143
147
|
/** Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed */
|
|
144
148
|
text: string;
|
|
145
149
|
}
|
|
150
|
+
interface Text extends Common {
|
|
151
|
+
/** Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed */
|
|
152
|
+
text: string;
|
|
153
|
+
/** The text to be copied to the clipboard; 1-256 characters */
|
|
154
|
+
style?: 'primary' | 'success' | 'danger';
|
|
155
|
+
/** Style of the button. Must be one of "danger" (red), "success" (green) or "primary" (blue). If omitted, then an app-specific style is used. */
|
|
156
|
+
icon_custom_emoji_id?: string;
|
|
157
|
+
}
|
|
146
158
|
interface RequestUsers extends Common {
|
|
147
159
|
/** 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. */
|
|
148
160
|
request_users: KeyboardButtonRequestUsers;
|
|
@@ -169,7 +181,7 @@ export declare namespace KeyboardButton {
|
|
|
169
181
|
}
|
|
170
182
|
}
|
|
171
183
|
/** This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_user, request_chat, request_contact, request_location, and request_poll are mutually exclusive. */
|
|
172
|
-
export type KeyboardButton = KeyboardButton.RequestUsers | KeyboardButton.RequestChat | KeyboardButton.RequestPoll | KeyboardButton.RequestContact | KeyboardButton.RequestLocation | KeyboardButton.WebApp | string;
|
|
184
|
+
export type KeyboardButton = KeyboardButton.Text | KeyboardButton.RequestUsers | KeyboardButton.RequestChat | KeyboardButton.RequestPoll | KeyboardButton.RequestContact | KeyboardButton.RequestLocation | KeyboardButton.WebApp | string;
|
|
173
185
|
/** This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. */
|
|
174
186
|
export interface KeyboardButtonPollType {
|
|
175
187
|
/** If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type. */
|
package/methods.d.ts
CHANGED
|
@@ -1488,27 +1488,6 @@ export type ApiMethods<F> = {
|
|
|
1488
1488
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
1489
1489
|
message_id?: number;
|
|
1490
1490
|
/** Required if chat_id and message_id are not specified. Identifier of the inline message */
|
|
1491
|
-
inline_message_id?: undefined;
|
|
1492
|
-
/** New text of the message, 1-4096 characters after entities parsing */
|
|
1493
|
-
text: string;
|
|
1494
|
-
/** Mode for parsing entities in the message text. See formatting options for more details. */
|
|
1495
|
-
parse_mode?: ParseMode;
|
|
1496
|
-
/** A list of special entities that appear in message text, which can be specified instead of parse_mode */
|
|
1497
|
-
entities?: MessageEntity[];
|
|
1498
|
-
/** Link preview generation options for the message */
|
|
1499
|
-
link_preview_options?: LinkPreviewOptions;
|
|
1500
|
-
/** An object for an inline keyboard. */
|
|
1501
|
-
reply_markup?: InlineKeyboardMarkup;
|
|
1502
|
-
}): Update.Edited & Message.TextMessage & Message.BusinessSentMessage;
|
|
1503
|
-
/** Use this method to edit inline text and game messages. On success, True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1504
|
-
editMessageText(args: {
|
|
1505
|
-
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1506
|
-
business_connection_id?: string;
|
|
1507
|
-
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
|
|
1508
|
-
chat_id?: undefined;
|
|
1509
|
-
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
1510
|
-
message_id?: undefined;
|
|
1511
|
-
/** Required if chat_id and message_id are not specified. Identifier of the inline message */
|
|
1512
1491
|
inline_message_id?: string;
|
|
1513
1492
|
/** New text of the message, 1-4096 characters after entities parsing */
|
|
1514
1493
|
text: string;
|
|
@@ -1520,7 +1499,7 @@ export type ApiMethods<F> = {
|
|
|
1520
1499
|
link_preview_options?: LinkPreviewOptions;
|
|
1521
1500
|
/** An object for an inline keyboard. */
|
|
1522
1501
|
reply_markup?: InlineKeyboardMarkup;
|
|
1523
|
-
}): true;
|
|
1502
|
+
}): (Update.Edited & Message.TextMessage & Message.BusinessSentMessage) | true;
|
|
1524
1503
|
/** Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1525
1504
|
editMessageCaption(args: {
|
|
1526
1505
|
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|