@telegram.ts/types 1.0.1 → 1.3.1
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/package.json +1 -1
- package/src/apiMethodsTypes.d.ts +1676 -0
- package/src/botCommandTypes.d.ts +183 -0
- package/src/index.d.ts +10 -10
- package/src/index.js +1 -1
- package/src/{inline.d.ts → inlineTypes.d.ts} +32 -19
- package/src/invoiceTypes.d.ts +145 -0
- package/src/{manage.d.ts → manageTypes.d.ts} +42 -36
- package/src/{markup.d.ts → markupTypes.d.ts} +26 -12
- package/src/{message.d.ts → messageTypes.d.ts} +99 -69
- package/src/passportTypes.d.ts +257 -0
- package/src/telegramTypes.d.ts +49 -0
- package/src/updateTypes.d.ts +128 -0
- package/src/api.d.ts +0 -22
- package/src/methods.d.ts +0 -1543
- package/src/passport.d.ts +0 -163
- package/src/payment.d.ts +0 -103
- package/src/settings.d.ts +0 -122
- package/src/update.d.ts +0 -74
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { WebAppInfo } from "./markupTypes.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This interface represents the name of the bot.
|
|
5
|
+
*/
|
|
6
|
+
export interface BotName {
|
|
7
|
+
/** The bot's name. */
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This interface represents the description of the bot.
|
|
13
|
+
*/
|
|
14
|
+
export interface BotDescription {
|
|
15
|
+
/** The bot's description. */
|
|
16
|
+
description: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* This interface represents the short description of the bot.
|
|
21
|
+
*/
|
|
22
|
+
export interface BotShortDescription {
|
|
23
|
+
/** The bot's short description. */
|
|
24
|
+
short_description: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* This interface describes the bot's menu button in a private chat.
|
|
29
|
+
* It can be one of the following:
|
|
30
|
+
* - MenuButtonCommands
|
|
31
|
+
* - MenuButtonWebApp
|
|
32
|
+
* - MenuButtonDefault
|
|
33
|
+
*
|
|
34
|
+
* If a menu button other than MenuButtonDefault is set for a private chat,
|
|
35
|
+
* then it is applied in the chat. Otherwise, the default menu button is applied.
|
|
36
|
+
* By default, the menu button opens the list of bot commands.
|
|
37
|
+
*/
|
|
38
|
+
export type MenuButton =
|
|
39
|
+
| MenuButtonCommands
|
|
40
|
+
| MenuButtonWebApp
|
|
41
|
+
| MenuButtonDefault;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Represents a menu button that opens the bot's list of commands.
|
|
45
|
+
*/
|
|
46
|
+
export interface MenuButtonCommands {
|
|
47
|
+
/** The type of the button, must be "commands". */
|
|
48
|
+
type: "commands";
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Represents a menu button that launches a Web App.
|
|
53
|
+
*/
|
|
54
|
+
export interface MenuButtonWebApp {
|
|
55
|
+
/** The button type, must be "web_app". */
|
|
56
|
+
type: "web_app";
|
|
57
|
+
/** The text on the button. */
|
|
58
|
+
text: string;
|
|
59
|
+
/**
|
|
60
|
+
* The description of the Web App that will be launched when the user presses the button.
|
|
61
|
+
* The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery.
|
|
62
|
+
*/
|
|
63
|
+
web_app: WebAppInfo;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Describes that no specific value for the menu button was set.
|
|
68
|
+
*/
|
|
69
|
+
export interface MenuButtonDefault {
|
|
70
|
+
/** The type of the button, must be "default". */
|
|
71
|
+
type: "default";
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* This interface represents the scope to which bot commands are applied.
|
|
76
|
+
* Currently, the following 7 scopes are supported:
|
|
77
|
+
* - BotCommandScopeDefault
|
|
78
|
+
* - BotCommandScopeAllPrivateChats
|
|
79
|
+
* - BotCommandScopeAllGroupChats
|
|
80
|
+
* - BotCommandScopeAllChatAdministrators
|
|
81
|
+
* - BotCommandScopeChat
|
|
82
|
+
* - BotCommandScopeChatAdministrators
|
|
83
|
+
* - BotCommandScopeChatMember
|
|
84
|
+
*
|
|
85
|
+
* Determining list of commands:
|
|
86
|
+
* The following algorithm is used to determine the list of commands for a particular user viewing the bot menu.
|
|
87
|
+
* The first list of commands that is set is returned.
|
|
88
|
+
*
|
|
89
|
+
* Commands in the chat with the bot:
|
|
90
|
+
* - botCommandScopeChat + language_code
|
|
91
|
+
* - botCommandScopeChat
|
|
92
|
+
* - botCommandScopeAllPrivateChats + language_code
|
|
93
|
+
* - botCommandScopeAllPrivateChats
|
|
94
|
+
* - botCommandScopeDefault + language_code
|
|
95
|
+
* - botCommandScopeDefault
|
|
96
|
+
*
|
|
97
|
+
* Commands in group and supergroup chats:
|
|
98
|
+
* - botCommandScopeChatMember + language_code
|
|
99
|
+
* - botCommandScopeChatMember
|
|
100
|
+
* - botCommandScopeChatAdministrators + language_code (administrators only)
|
|
101
|
+
* - botCommandScopeChatAdministrators (administrators only)
|
|
102
|
+
* - botCommandScopeChat + language_code
|
|
103
|
+
* - botCommandScopeChat
|
|
104
|
+
* - botCommandScopeAllChatAdministrators + language_code (administrators only)
|
|
105
|
+
* - botCommandScopeAllChatAdministrators (administrators only)
|
|
106
|
+
* - botCommandScopeAllGroupChats + language_code
|
|
107
|
+
* - botCommandScopeAllGroupChats
|
|
108
|
+
* - botCommandScopeDefault + language_code
|
|
109
|
+
* - botCommandScopeDefault
|
|
110
|
+
*/
|
|
111
|
+
export type BotCommandScope =
|
|
112
|
+
| BotCommandScopeDefault
|
|
113
|
+
| BotCommandScopeAllPrivateChats
|
|
114
|
+
| BotCommandScopeAllGroupChats
|
|
115
|
+
| BotCommandScopeAllChatAdministrators
|
|
116
|
+
| BotCommandScopeChat
|
|
117
|
+
| BotCommandScopeChatAdministrators
|
|
118
|
+
| BotCommandScopeChatMember;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Represents the default scope of bot commands.
|
|
122
|
+
* Default commands are used if no commands with a narrower scope are specified for the user.
|
|
123
|
+
*/
|
|
124
|
+
export interface BotCommandScopeDefault {
|
|
125
|
+
/** The scope type, must be "default". */
|
|
126
|
+
type: "default";
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Represents the scope of bot commands, covering all private chats.
|
|
131
|
+
*/
|
|
132
|
+
export interface BotCommandScopeAllPrivateChats {
|
|
133
|
+
/** The scope type, must be "all_private_chats". */
|
|
134
|
+
type: "all_private_chats";
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Represents the scope of bot commands, covering all group and supergroup chats.
|
|
139
|
+
*/
|
|
140
|
+
export interface BotCommandScopeAllGroupChats {
|
|
141
|
+
/** The scope type, must be "all_group_chats". */
|
|
142
|
+
type: "all_group_chats";
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Represents the scope of bot commands, covering all group and supergroup chat administrators.
|
|
147
|
+
*/
|
|
148
|
+
export interface BotCommandScopeAllChatAdministrators {
|
|
149
|
+
/** The scope type, must be "all_chat_administrators". */
|
|
150
|
+
type: "all_chat_administrators";
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Represents the scope of bot commands, covering a specific chat.
|
|
155
|
+
*/
|
|
156
|
+
export interface BotCommandScopeChat {
|
|
157
|
+
/** The scope type, must be "chat". */
|
|
158
|
+
type: "chat";
|
|
159
|
+
/** The unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). */
|
|
160
|
+
chat_id: number | string;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
|
|
165
|
+
*/
|
|
166
|
+
export interface BotCommandScopeChatAdministrators {
|
|
167
|
+
/** The scope type, must be "chat_administrators". */
|
|
168
|
+
type: "chat_administrators";
|
|
169
|
+
/** The unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). */
|
|
170
|
+
chat_id: number | string;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
|
|
175
|
+
*/
|
|
176
|
+
export interface BotCommandScopeChatMember {
|
|
177
|
+
/** The scope type, must be "chat_member". */
|
|
178
|
+
type: "chat_member";
|
|
179
|
+
/** The unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). */
|
|
180
|
+
chat_id: number | string;
|
|
181
|
+
/** The unique identifier of the target user. */
|
|
182
|
+
user_id: number;
|
|
183
|
+
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./
|
|
1
|
+
export * from "./telegramTypes.js";
|
|
2
|
+
export * from "./inlineTypes.js";
|
|
3
|
+
export * from "./manageTypes.js";
|
|
4
|
+
export * from "./markupTypes.js";
|
|
5
|
+
export * from "./messageTypes.js";
|
|
6
|
+
export * from "./apiMethodsTypes.js";
|
|
7
|
+
export * from "./passportTypes.js";
|
|
8
|
+
export * from "./invoiceTypes.js";
|
|
9
|
+
export * from "./botCommandTypes.js";
|
|
10
|
+
export * from "./updateTypes.js";
|
package/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// cjs module
|
|
2
|
-
// module.exports
|
|
2
|
+
// module.exports
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./
|
|
5
|
-
import type {
|
|
6
|
-
InlineKeyboardMarkup,
|
|
7
|
-
WebAppInfo
|
|
8
|
-
} from "./markup.js";
|
|
9
|
-
import type {
|
|
10
|
-
Location,
|
|
11
|
-
MessageEntity,
|
|
12
|
-
ParseMode
|
|
13
|
-
} from "./message.js";
|
|
14
|
-
import type {
|
|
15
|
-
LabeledPrice
|
|
16
|
-
} from "./payment.js";
|
|
1
|
+
import type { Chat, User } from "./manageTypes.js";
|
|
2
|
+
import type { InlineKeyboardMarkup, WebAppInfo } from "./markupTypes.js";
|
|
3
|
+
import type { Location, MessageEntity, ParseMode } from "./messageTypes.js";
|
|
4
|
+
import type { LabeledPrice } from "./invoiceTypes.js";
|
|
17
5
|
/** This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. */
|
|
18
6
|
export interface InlineQuery {
|
|
19
7
|
/** Unique identifier for this query */
|
|
@@ -52,7 +40,27 @@ export interface InlineQuery {
|
|
|
52
40
|
- InlineQueryResultVoice
|
|
53
41
|
|
|
54
42
|
Note: All URLs passed in inline query results will be available to end users and therefore must be assumed to be public. */
|
|
55
|
-
export type InlineQueryResult =
|
|
43
|
+
export type InlineQueryResult =
|
|
44
|
+
| InlineQueryResultCachedAudio
|
|
45
|
+
| InlineQueryResultCachedDocument
|
|
46
|
+
| InlineQueryResultCachedGif
|
|
47
|
+
| InlineQueryResultCachedMpeg4Gif
|
|
48
|
+
| InlineQueryResultCachedPhoto
|
|
49
|
+
| InlineQueryResultCachedSticker
|
|
50
|
+
| InlineQueryResultCachedVideo
|
|
51
|
+
| InlineQueryResultCachedVoice
|
|
52
|
+
| InlineQueryResultArticle
|
|
53
|
+
| InlineQueryResultAudio
|
|
54
|
+
| InlineQueryResultContact
|
|
55
|
+
| InlineQueryResultGame
|
|
56
|
+
| InlineQueryResultDocument
|
|
57
|
+
| InlineQueryResultGif
|
|
58
|
+
| InlineQueryResultLocation
|
|
59
|
+
| InlineQueryResultMpeg4Gif
|
|
60
|
+
| InlineQueryResultPhoto
|
|
61
|
+
| InlineQueryResultVenue
|
|
62
|
+
| InlineQueryResultVideo
|
|
63
|
+
| InlineQueryResultVoice;
|
|
56
64
|
/** Represents a link to an article or web page. */
|
|
57
65
|
export interface InlineQueryResultArticle {
|
|
58
66
|
/** Type of the result, must be article */
|
|
@@ -565,7 +573,12 @@ export interface InlineQueryResultCachedAudio {
|
|
|
565
573
|
- InputVenueMessageContent
|
|
566
574
|
- InputContactMessageContent
|
|
567
575
|
- InputInvoiceMessageContent */
|
|
568
|
-
export type InputMessageContent =
|
|
576
|
+
export type InputMessageContent =
|
|
577
|
+
| InputTextMessageContent
|
|
578
|
+
| InputLocationMessageContent
|
|
579
|
+
| InputVenueMessageContent
|
|
580
|
+
| InputContactMessageContent
|
|
581
|
+
| InputInvoiceMessageContent;
|
|
569
582
|
/** Represents the content of a text message to be sent as the result of an inline query. */
|
|
570
583
|
export interface InputTextMessageContent {
|
|
571
584
|
/** Text of the message to be sent, 1-4096 characters */
|
|
@@ -690,4 +703,4 @@ export interface InlineQueryResultsButton {
|
|
|
690
703
|
web_app?: WebAppInfo;
|
|
691
704
|
/** Deep-linking parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only `A-Z`, `a-z`, `0-9`, `_` and `-` are allowed. */
|
|
692
705
|
start_parameter?: string;
|
|
693
|
-
}
|
|
706
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { User } from "./manageTypes.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This interface represents a labeled portion of the price for goods or services.
|
|
5
|
+
*/
|
|
6
|
+
export interface LabeledPrice {
|
|
7
|
+
/** The label of the portion. */
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* The price of the product in the smallest units of the currency (integer, not float/double).
|
|
11
|
+
* For example, for a price of US$ 1.45, the amount would be 145.
|
|
12
|
+
* See the 'exp' parameter in currencies.json for the number of digits past the decimal point for each currency
|
|
13
|
+
* (2 for the majority of currencies).
|
|
14
|
+
*/
|
|
15
|
+
amount: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This interface contains basic information about an invoice.
|
|
20
|
+
*/
|
|
21
|
+
export interface Invoice {
|
|
22
|
+
/** The name of the product. */
|
|
23
|
+
title: string;
|
|
24
|
+
/** The description of the product. */
|
|
25
|
+
description: string;
|
|
26
|
+
/** A unique bot deep-linking parameter that can be used to generate this invoice. */
|
|
27
|
+
start_parameter: string;
|
|
28
|
+
/** The three-letter ISO 4217 currency code. */
|
|
29
|
+
currency: string;
|
|
30
|
+
/**
|
|
31
|
+
* The total price in the smallest units of the currency (integer, not float/double).
|
|
32
|
+
* For example, for a price of US$ 1.45, the total_amount would be 145.
|
|
33
|
+
* See the 'exp' parameter in currencies.json for the number of digits past the decimal point for each currency
|
|
34
|
+
* (2 for the majority of currencies).
|
|
35
|
+
*/
|
|
36
|
+
total_amount: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* This interface represents a shipping address.
|
|
41
|
+
*/
|
|
42
|
+
export interface ShippingAddress {
|
|
43
|
+
/** The two-letter ISO 3166-1 alpha-2 country code. */
|
|
44
|
+
country_code: string;
|
|
45
|
+
/** The state, if applicable. */
|
|
46
|
+
state: string;
|
|
47
|
+
/** The city. */
|
|
48
|
+
city: string;
|
|
49
|
+
/** The first line for the address. */
|
|
50
|
+
street_line1: string;
|
|
51
|
+
/** The second line for the address. */
|
|
52
|
+
street_line2: string;
|
|
53
|
+
/** The address postal code. */
|
|
54
|
+
post_code: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* This interface represents information about an order.
|
|
59
|
+
*/
|
|
60
|
+
export interface OrderInfo {
|
|
61
|
+
/** The user's name. */
|
|
62
|
+
name?: string;
|
|
63
|
+
/** The user's phone number. */
|
|
64
|
+
phone_number?: string;
|
|
65
|
+
/** The user's email. */
|
|
66
|
+
email?: string;
|
|
67
|
+
/** The user's shipping address. */
|
|
68
|
+
shipping_address?: ShippingAddress;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* This interface represents a shipping option.
|
|
73
|
+
*/
|
|
74
|
+
export interface ShippingOption {
|
|
75
|
+
/** The shipping option identifier. */
|
|
76
|
+
id: string;
|
|
77
|
+
/** The title of the option. */
|
|
78
|
+
title: string;
|
|
79
|
+
/** The list of price portions. */
|
|
80
|
+
prices: LabeledPrice[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* This interface contains basic information about a successful payment.
|
|
85
|
+
*/
|
|
86
|
+
export interface SuccessfulPayment {
|
|
87
|
+
/** The three-letter ISO 4217 currency code. */
|
|
88
|
+
currency: string;
|
|
89
|
+
/**
|
|
90
|
+
* The total price in the smallest units of the currency (integer, not float/double).
|
|
91
|
+
* For example, for a price of US$ 1.45, the total_amount would be 145.
|
|
92
|
+
* See the 'exp' parameter in currencies.json for the number of digits past the decimal point for each currency
|
|
93
|
+
* (2 for the majority of currencies).
|
|
94
|
+
*/
|
|
95
|
+
total_amount: number;
|
|
96
|
+
/** The bot-specified invoice payload. */
|
|
97
|
+
invoice_payload: string;
|
|
98
|
+
/** The identifier of the shipping option chosen by the user. */
|
|
99
|
+
shipping_option_id?: string;
|
|
100
|
+
/** The order information provided by the user. */
|
|
101
|
+
order_info?: OrderInfo;
|
|
102
|
+
/** The Telegram payment identifier. */
|
|
103
|
+
telegram_payment_charge_id: string;
|
|
104
|
+
/** The provider payment identifier. */
|
|
105
|
+
provider_payment_charge_id: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* This interface contains information about an incoming shipping query.
|
|
110
|
+
*/
|
|
111
|
+
export interface ShippingQuery {
|
|
112
|
+
/** The unique query identifier. */
|
|
113
|
+
id: string;
|
|
114
|
+
/** The user who sent the query. */
|
|
115
|
+
from: User;
|
|
116
|
+
/** The bot-specified invoice payload. */
|
|
117
|
+
invoice_payload: string;
|
|
118
|
+
/** The user-specified shipping address. */
|
|
119
|
+
shipping_address: ShippingAddress;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* This interface contains information about an incoming pre-checkout query.
|
|
124
|
+
*/
|
|
125
|
+
export interface PreCheckoutQuery {
|
|
126
|
+
/** The unique query identifier. */
|
|
127
|
+
id: string;
|
|
128
|
+
/** The user who sent the query. */
|
|
129
|
+
from: User;
|
|
130
|
+
/** The three-letter ISO 4217 currency code. */
|
|
131
|
+
currency: string;
|
|
132
|
+
/**
|
|
133
|
+
* The total price in the smallest units of the currency (integer, not float/double).
|
|
134
|
+
* For example, for a price of US$ 1.45, the total_amount would be 145.
|
|
135
|
+
* See the 'exp' parameter in currencies.json for the number of digits past the decimal point for each currency
|
|
136
|
+
* (2 for the majority of currencies).
|
|
137
|
+
*/
|
|
138
|
+
total_amount: number;
|
|
139
|
+
/** The bot-specified invoice payload. */
|
|
140
|
+
invoice_payload: string;
|
|
141
|
+
/** The identifier of the shipping option chosen by the user. */
|
|
142
|
+
shipping_option_id?: string;
|
|
143
|
+
/** The order information provided by the user. */
|
|
144
|
+
order_info?: OrderInfo;
|
|
145
|
+
}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
Message,
|
|
4
|
-
PhotoSize
|
|
5
|
-
} from "./message.js";
|
|
6
|
-
import type {
|
|
7
|
-
Update
|
|
8
|
-
} from "./update.js";
|
|
1
|
+
import type { Location, Message, PhotoSize } from "./messageTypes.js";
|
|
2
|
+
import type { Update } from "./updateTypes.js";
|
|
9
3
|
/** Describes the current status of a webhook. */
|
|
10
4
|
export interface WebhookInfo {
|
|
11
5
|
/** Webhook URL, may be empty if webhook is not set up */
|
|
@@ -25,8 +19,7 @@ export interface WebhookInfo {
|
|
|
25
19
|
/** The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */
|
|
26
20
|
max_connections: number;
|
|
27
21
|
/** A list of update types the bot is subscribed to. Defaults to all update types except chat_member */
|
|
28
|
-
allowed_updates: Array
|
|
29
|
-
"update_id">>;
|
|
22
|
+
allowed_updates: Array<Exclude<keyof Update, "update_id">>;
|
|
30
23
|
}
|
|
31
24
|
/** This object represents a Telegram user or bot. */
|
|
32
25
|
export interface User {
|
|
@@ -77,8 +70,7 @@ export declare namespace Chat {
|
|
|
77
70
|
title: string;
|
|
78
71
|
}
|
|
79
72
|
/** Internal type representing private chats. */
|
|
80
|
-
export interface PrivateChat extends AbstractChat,
|
|
81
|
-
UserNameChat {
|
|
73
|
+
export interface PrivateChat extends AbstractChat, UserNameChat {
|
|
82
74
|
type: "private";
|
|
83
75
|
/** First name of the other party in a private chat */
|
|
84
76
|
first_name: string;
|
|
@@ -86,22 +78,20 @@ export declare namespace Chat {
|
|
|
86
78
|
last_name?: string;
|
|
87
79
|
}
|
|
88
80
|
/** Internal type representing group chats. */
|
|
89
|
-
export interface GroupChat extends AbstractChat,
|
|
90
|
-
TitleChat {
|
|
81
|
+
export interface GroupChat extends AbstractChat, TitleChat {
|
|
91
82
|
type: "group";
|
|
92
83
|
}
|
|
93
84
|
/** Internal type representing super group chats. */
|
|
94
|
-
export interface SupergroupChat
|
|
95
|
-
|
|
96
|
-
|
|
85
|
+
export interface SupergroupChat
|
|
86
|
+
extends AbstractChat,
|
|
87
|
+
UserNameChat,
|
|
88
|
+
TitleChat {
|
|
97
89
|
type: "supergroup";
|
|
98
90
|
/** True, if the supergroup chat is a forum (has topics enabled) */
|
|
99
91
|
is_forum?: true;
|
|
100
92
|
}
|
|
101
93
|
/** Internal type representing channel chats. */
|
|
102
|
-
export interface ChannelChat extends AbstractChat,
|
|
103
|
-
UserNameChat,
|
|
104
|
-
TitleChat {
|
|
94
|
+
export interface ChannelChat extends AbstractChat, UserNameChat, TitleChat {
|
|
105
95
|
type: "channel";
|
|
106
96
|
}
|
|
107
97
|
/** Internal type holding properties that those chats returned from `getChat` share. */
|
|
@@ -140,9 +130,10 @@ export declare namespace Chat {
|
|
|
140
130
|
linked_chat_id?: number;
|
|
141
131
|
}
|
|
142
132
|
/** Internal type representing private chats returned from `getChat`. */
|
|
143
|
-
export interface PrivateGetChat
|
|
144
|
-
|
|
145
|
-
|
|
133
|
+
export interface PrivateGetChat
|
|
134
|
+
extends PrivateChat,
|
|
135
|
+
NonGroupGetChat,
|
|
136
|
+
GetChat {
|
|
146
137
|
/** Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. */
|
|
147
138
|
emoji_status_custom_emoji_id?: string;
|
|
148
139
|
/** Bio of the other party in a private chat. Returned only in getChat. */
|
|
@@ -153,13 +144,13 @@ export declare namespace Chat {
|
|
|
153
144
|
has_restricted_voice_and_video_messages?: true;
|
|
154
145
|
}
|
|
155
146
|
/** Internal type representing group chats returned from `getChat`. */
|
|
156
|
-
export interface GroupGetChat extends GroupChat,
|
|
157
|
-
MultiUserGetChat {}
|
|
147
|
+
export interface GroupGetChat extends GroupChat, MultiUserGetChat {}
|
|
158
148
|
/** Internal type representing supergroup chats returned from `getChat`. */
|
|
159
|
-
export interface SupergroupGetChat
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
149
|
+
export interface SupergroupGetChat
|
|
150
|
+
extends SupergroupChat,
|
|
151
|
+
NonGroupGetChat,
|
|
152
|
+
MultiUserGetChat,
|
|
153
|
+
LargeGetChat {
|
|
163
154
|
/** True, if users need to join the supergroup before they can send messages. Returned only in getChat. */
|
|
164
155
|
join_to_send_messages?: true;
|
|
165
156
|
/** True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat. */
|
|
@@ -174,15 +165,24 @@ export declare namespace Chat {
|
|
|
174
165
|
location?: ChatLocation;
|
|
175
166
|
}
|
|
176
167
|
/** Internal type representing channel chats returned from `getChat`. */
|
|
177
|
-
export interface ChannelGetChat
|
|
178
|
-
|
|
179
|
-
|
|
168
|
+
export interface ChannelGetChat
|
|
169
|
+
extends ChannelChat,
|
|
170
|
+
NonGroupGetChat,
|
|
171
|
+
LargeGetChat {}
|
|
180
172
|
export {};
|
|
181
173
|
}
|
|
182
174
|
/** This object represents a chat. */
|
|
183
|
-
export type Chat =
|
|
175
|
+
export type Chat =
|
|
176
|
+
| Chat.PrivateChat
|
|
177
|
+
| Chat.GroupChat
|
|
178
|
+
| Chat.SupergroupChat
|
|
179
|
+
| Chat.ChannelChat;
|
|
184
180
|
/** This object represents a Telegram user or bot that was returned by `getChat`. */
|
|
185
|
-
export type ChatFromGetChat =
|
|
181
|
+
export type ChatFromGetChat =
|
|
182
|
+
| Chat.PrivateGetChat
|
|
183
|
+
| Chat.GroupGetChat
|
|
184
|
+
| Chat.SupergroupGetChat
|
|
185
|
+
| Chat.ChannelGetChat;
|
|
186
186
|
/** This object represent a user's profile pictures. */
|
|
187
187
|
export interface UserProfilePhotos {
|
|
188
188
|
/** Total number of profile pictures the target user has */
|
|
@@ -256,7 +256,13 @@ export interface ChatAdministratorRights {
|
|
|
256
256
|
- ChatMemberRestricted
|
|
257
257
|
- ChatMemberLeft
|
|
258
258
|
- ChatMemberBanned */
|
|
259
|
-
export type ChatMember =
|
|
259
|
+
export type ChatMember =
|
|
260
|
+
| ChatMemberOwner
|
|
261
|
+
| ChatMemberAdministrator
|
|
262
|
+
| ChatMemberMember
|
|
263
|
+
| ChatMemberRestricted
|
|
264
|
+
| ChatMemberLeft
|
|
265
|
+
| ChatMemberBanned;
|
|
260
266
|
/** Represents a chat member that owns the chat and has all administrator privileges. */
|
|
261
267
|
export interface ChatMemberOwner {
|
|
262
268
|
/** The member's status in the chat, always “creator” */
|
|
@@ -463,4 +469,4 @@ export interface File {
|
|
|
463
469
|
file_size?: number;
|
|
464
470
|
/** File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */
|
|
465
471
|
file_path?: string;
|
|
466
|
-
}
|
|
472
|
+
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
User
|
|
4
|
-
} from "./manage.js";
|
|
5
|
-
import type {
|
|
6
|
-
Message
|
|
7
|
-
} from "./message.js";
|
|
1
|
+
import type { ChatAdministratorRights, User } from "./manageTypes.js";
|
|
2
|
+
import type { Message } from "./messageTypes.js";
|
|
8
3
|
/** This object represents an inline keyboard that appears right next to the message it belongs to. */
|
|
9
4
|
export interface InlineKeyboardMarkup {
|
|
10
5
|
/** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
|
|
@@ -37,13 +32,15 @@ export declare namespace InlineKeyboardButton {
|
|
|
37
32
|
Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm... actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen. */
|
|
38
33
|
switch_inline_query: string;
|
|
39
34
|
}
|
|
40
|
-
export interface SwitchInlineCurrentChatButton
|
|
35
|
+
export interface SwitchInlineCurrentChatButton
|
|
36
|
+
extends AbstractInlineKeyboardButton {
|
|
41
37
|
/** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted.
|
|
42
38
|
|
|
43
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. */
|
|
44
40
|
switch_inline_query_current_chat: string;
|
|
45
41
|
}
|
|
46
|
-
export interface SwitchInlineChosenChatButton
|
|
42
|
+
export interface SwitchInlineChosenChatButton
|
|
43
|
+
extends AbstractInlineKeyboardButton {
|
|
47
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 */
|
|
48
45
|
switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat;
|
|
49
46
|
}
|
|
@@ -62,7 +59,16 @@ export declare namespace InlineKeyboardButton {
|
|
|
62
59
|
export {};
|
|
63
60
|
}
|
|
64
61
|
/** This object represents one button of an inline keyboard. You must use exactly one of the optional fields. */
|
|
65
|
-
export type InlineKeyboardButton =
|
|
62
|
+
export type InlineKeyboardButton =
|
|
63
|
+
| InlineKeyboardButton.CallbackButton
|
|
64
|
+
| InlineKeyboardButton.GameButton
|
|
65
|
+
| InlineKeyboardButton.LoginButton
|
|
66
|
+
| InlineKeyboardButton.PayButton
|
|
67
|
+
| InlineKeyboardButton.SwitchInlineButton
|
|
68
|
+
| InlineKeyboardButton.SwitchInlineCurrentChatButton
|
|
69
|
+
| InlineKeyboardButton.SwitchInlineChosenChatButton
|
|
70
|
+
| InlineKeyboardButton.UrlButton
|
|
71
|
+
| InlineKeyboardButton.WebAppButton;
|
|
66
72
|
/** 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.
|
|
67
73
|
Telegram apps support these buttons as of version 5.7. */
|
|
68
74
|
export interface LoginUrl {
|
|
@@ -159,7 +165,15 @@ export declare namespace KeyboardButton {
|
|
|
159
165
|
}
|
|
160
166
|
}
|
|
161
167
|
/** 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. */
|
|
162
|
-
export type KeyboardButton =
|
|
168
|
+
export type KeyboardButton =
|
|
169
|
+
| KeyboardButton.CommonButton
|
|
170
|
+
| KeyboardButton.RequestUserButton
|
|
171
|
+
| KeyboardButton.RequestChatButton
|
|
172
|
+
| KeyboardButton.RequestContactButton
|
|
173
|
+
| KeyboardButton.RequestLocationButton
|
|
174
|
+
| KeyboardButton.RequestPollButton
|
|
175
|
+
| KeyboardButton.WebAppButton
|
|
176
|
+
| string;
|
|
163
177
|
/** This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. */
|
|
164
178
|
export interface KeyboardButtonPollType {
|
|
165
179
|
/** 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. */
|
|
@@ -223,4 +237,4 @@ export interface KeyboardButtonRequestChat {
|
|
|
223
237
|
bot_administrator_rights?: ChatAdministratorRights;
|
|
224
238
|
/** Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. */
|
|
225
239
|
bot_is_member?: boolean;
|
|
226
|
-
}
|
|
240
|
+
}
|