@telegram.ts/types 1.3.0 → 1.3.2
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/README.md +4 -1
- package/package.json +2 -2
- package/src/apiMethodsTypes.d.ts +143 -58
- package/src/botCommandTypes.d.ts +89 -90
- package/src/index.d.ts +1 -1
- package/src/index.js +5 -2
- package/src/inlineTypes.d.ts +32 -19
- package/src/invoiceTypes.d.ts +39 -43
- package/src/manageTypes.d.ts +45 -39
- package/src/markupTypes.d.ts +26 -12
- package/src/messageTypes.d.ts +95 -65
- package/src/passportTypes.d.ts +77 -17
- package/src/telegramTypes.d.ts +25 -25
- package/src/updateTypes.d.ts +57 -70
package/src/botCommandTypes.d.ts
CHANGED
|
@@ -1,159 +1,158 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
WebAppInfo
|
|
3
|
-
} from "./markupTypes.js";
|
|
1
|
+
import type { WebAppInfo } from "./markupTypes.js";
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
|
-
* This interface represents the name of the bot.
|
|
7
|
-
*/
|
|
4
|
+
* This interface represents the name of the bot.
|
|
5
|
+
*/
|
|
8
6
|
export interface BotName {
|
|
9
7
|
/** The bot's name. */
|
|
10
8
|
name: string;
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
|
-
* This interface represents the description of the bot.
|
|
15
|
-
*/
|
|
12
|
+
* This interface represents the description of the bot.
|
|
13
|
+
*/
|
|
16
14
|
export interface BotDescription {
|
|
17
15
|
/** The bot's description. */
|
|
18
16
|
description: string;
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
|
-
* This interface represents the short description of the bot.
|
|
23
|
-
*/
|
|
20
|
+
* This interface represents the short description of the bot.
|
|
21
|
+
*/
|
|
24
22
|
export interface BotShortDescription {
|
|
25
23
|
/** The bot's short description. */
|
|
26
24
|
short_description: string;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
/**
|
|
30
|
-
* This interface describes the bot's menu button in a private chat.
|
|
31
|
-
* It can be one of the following:
|
|
32
|
-
* - MenuButtonCommands
|
|
33
|
-
* - MenuButtonWebApp
|
|
34
|
-
* - MenuButtonDefault
|
|
35
|
-
*
|
|
36
|
-
* If a menu button other than MenuButtonDefault is set for a private chat,
|
|
37
|
-
* then it is applied in the chat. Otherwise, the default menu button is applied.
|
|
38
|
-
* By default, the menu button opens the list of bot commands.
|
|
39
|
-
*/
|
|
40
|
-
export type MenuButton =
|
|
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;
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
|
-
* Represents a menu button that opens the bot's list of commands.
|
|
44
|
-
*/
|
|
44
|
+
* Represents a menu button that opens the bot's list of commands.
|
|
45
|
+
*/
|
|
45
46
|
export interface MenuButtonCommands {
|
|
46
47
|
/** The type of the button, must be "commands". */
|
|
47
48
|
type: "commands";
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
|
-
* Represents a menu button that launches a Web App.
|
|
52
|
-
*/
|
|
52
|
+
* Represents a menu button that launches a Web App.
|
|
53
|
+
*/
|
|
53
54
|
export interface MenuButtonWebApp {
|
|
54
55
|
/** The button type, must be "web_app". */
|
|
55
56
|
type: "web_app";
|
|
56
57
|
/** The text on the button. */
|
|
57
58
|
text: string;
|
|
58
59
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
+
*/
|
|
62
63
|
web_app: WebAppInfo;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
/**
|
|
66
|
-
* Describes that no specific value for the menu button was set.
|
|
67
|
-
*/
|
|
67
|
+
* Describes that no specific value for the menu button was set.
|
|
68
|
+
*/
|
|
68
69
|
export interface MenuButtonDefault {
|
|
69
70
|
/** The type of the button, must be "default". */
|
|
70
71
|
type: "default";
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
/**
|
|
74
|
-
* This interface represents the scope to which bot commands are applied.
|
|
75
|
-
* Currently, the following 7 scopes are supported:
|
|
76
|
-
* - BotCommandScopeDefault
|
|
77
|
-
* - BotCommandScopeAllPrivateChats
|
|
78
|
-
* - BotCommandScopeAllGroupChats
|
|
79
|
-
* - BotCommandScopeAllChatAdministrators
|
|
80
|
-
* - BotCommandScopeChat
|
|
81
|
-
* - BotCommandScopeChatAdministrators
|
|
82
|
-
* - BotCommandScopeChatMember
|
|
83
|
-
*
|
|
84
|
-
* Determining list of commands:
|
|
85
|
-
* The following algorithm is used to determine the list of commands for a particular user viewing the bot menu.
|
|
86
|
-
* The first list of commands that is set is returned.
|
|
87
|
-
*
|
|
88
|
-
* Commands in the chat with the bot:
|
|
89
|
-
* - botCommandScopeChat + language_code
|
|
90
|
-
* - botCommandScopeChat
|
|
91
|
-
* - botCommandScopeAllPrivateChats + language_code
|
|
92
|
-
* - botCommandScopeAllPrivateChats
|
|
93
|
-
* - botCommandScopeDefault + language_code
|
|
94
|
-
* - botCommandScopeDefault
|
|
95
|
-
*
|
|
96
|
-
* Commands in group and supergroup chats:
|
|
97
|
-
* - botCommandScopeChatMember + language_code
|
|
98
|
-
* - botCommandScopeChatMember
|
|
99
|
-
* - botCommandScopeChatAdministrators + language_code (administrators only)
|
|
100
|
-
* - botCommandScopeChatAdministrators (administrators only)
|
|
101
|
-
* - botCommandScopeChat + language_code
|
|
102
|
-
* - botCommandScopeChat
|
|
103
|
-
* - botCommandScopeAllChatAdministrators + language_code (administrators only)
|
|
104
|
-
* - botCommandScopeAllChatAdministrators (administrators only)
|
|
105
|
-
* - botCommandScopeAllGroupChats + language_code
|
|
106
|
-
* - botCommandScopeAllGroupChats
|
|
107
|
-
* - botCommandScopeDefault + language_code
|
|
108
|
-
* - botCommandScopeDefault
|
|
109
|
-
*/
|
|
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
|
+
*/
|
|
110
111
|
export type BotCommandScope =
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
| BotCommandScopeChatAdministrators
|
|
119
|
-
| BotCommandScopeChatMember;
|
|
112
|
+
| BotCommandScopeDefault
|
|
113
|
+
| BotCommandScopeAllPrivateChats
|
|
114
|
+
| BotCommandScopeAllGroupChats
|
|
115
|
+
| BotCommandScopeAllChatAdministrators
|
|
116
|
+
| BotCommandScopeChat
|
|
117
|
+
| BotCommandScopeChatAdministrators
|
|
118
|
+
| BotCommandScopeChatMember;
|
|
120
119
|
|
|
121
120
|
/**
|
|
122
|
-
* Represents the default scope of bot commands.
|
|
123
|
-
* Default commands are used if no commands with a narrower scope are specified for the user.
|
|
124
|
-
*/
|
|
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
|
+
*/
|
|
125
124
|
export interface BotCommandScopeDefault {
|
|
126
125
|
/** The scope type, must be "default". */
|
|
127
126
|
type: "default";
|
|
128
127
|
}
|
|
129
128
|
|
|
130
129
|
/**
|
|
131
|
-
* Represents the scope of bot commands, covering all private chats.
|
|
132
|
-
*/
|
|
130
|
+
* Represents the scope of bot commands, covering all private chats.
|
|
131
|
+
*/
|
|
133
132
|
export interface BotCommandScopeAllPrivateChats {
|
|
134
133
|
/** The scope type, must be "all_private_chats". */
|
|
135
134
|
type: "all_private_chats";
|
|
136
135
|
}
|
|
137
136
|
|
|
138
137
|
/**
|
|
139
|
-
* Represents the scope of bot commands, covering all group and supergroup chats.
|
|
140
|
-
*/
|
|
138
|
+
* Represents the scope of bot commands, covering all group and supergroup chats.
|
|
139
|
+
*/
|
|
141
140
|
export interface BotCommandScopeAllGroupChats {
|
|
142
141
|
/** The scope type, must be "all_group_chats". */
|
|
143
142
|
type: "all_group_chats";
|
|
144
143
|
}
|
|
145
144
|
|
|
146
145
|
/**
|
|
147
|
-
* Represents the scope of bot commands, covering all group and supergroup chat administrators.
|
|
148
|
-
*/
|
|
146
|
+
* Represents the scope of bot commands, covering all group and supergroup chat administrators.
|
|
147
|
+
*/
|
|
149
148
|
export interface BotCommandScopeAllChatAdministrators {
|
|
150
149
|
/** The scope type, must be "all_chat_administrators". */
|
|
151
150
|
type: "all_chat_administrators";
|
|
152
151
|
}
|
|
153
152
|
|
|
154
153
|
/**
|
|
155
|
-
* Represents the scope of bot commands, covering a specific chat.
|
|
156
|
-
*/
|
|
154
|
+
* Represents the scope of bot commands, covering a specific chat.
|
|
155
|
+
*/
|
|
157
156
|
export interface BotCommandScopeChat {
|
|
158
157
|
/** The scope type, must be "chat". */
|
|
159
158
|
type: "chat";
|
|
@@ -162,8 +161,8 @@ export interface BotCommandScopeChat {
|
|
|
162
161
|
}
|
|
163
162
|
|
|
164
163
|
/**
|
|
165
|
-
* Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
|
|
166
|
-
*/
|
|
164
|
+
* Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
|
|
165
|
+
*/
|
|
167
166
|
export interface BotCommandScopeChatAdministrators {
|
|
168
167
|
/** The scope type, must be "chat_administrators". */
|
|
169
168
|
type: "chat_administrators";
|
|
@@ -172,8 +171,8 @@ export interface BotCommandScopeChatAdministrators {
|
|
|
172
171
|
}
|
|
173
172
|
|
|
174
173
|
/**
|
|
175
|
-
* Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
|
|
176
|
-
*/
|
|
174
|
+
* Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
|
|
175
|
+
*/
|
|
177
176
|
export interface BotCommandScopeChatMember {
|
|
178
177
|
/** The scope type, must be "chat_member". */
|
|
179
178
|
type: "chat_member";
|
|
@@ -181,4 +180,4 @@ export interface BotCommandScopeChatMember {
|
|
|
181
180
|
chat_id: number | string;
|
|
182
181
|
/** The unique identifier of the target user. */
|
|
183
182
|
user_id: number;
|
|
184
|
-
}
|
|
183
|
+
}
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @telegram.ts/types is based on the source code of @grammyjs/types, with proper attribution and adherence to the original author's licensing terms.
|
|
3
|
+
* github - https://github.com/grammyjs/types
|
|
4
|
+
* npm - https://www.npmjs.com/package/@grammyjs/types?activeTab=readme
|
|
5
|
+
*/
|
package/src/inlineTypes.d.ts
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./
|
|
5
|
-
import type {
|
|
6
|
-
InlineKeyboardMarkup,
|
|
7
|
-
WebAppInfo
|
|
8
|
-
} from "./markupTypes.js";
|
|
9
|
-
import type {
|
|
10
|
-
Location,
|
|
11
|
-
MessageEntity,
|
|
12
|
-
ParseMode
|
|
13
|
-
} from "./messageTypes.js";
|
|
14
|
-
import type {
|
|
15
|
-
LabeledPrice
|
|
16
|
-
} from "./invoiceTypes.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
|
+
}
|
package/src/invoiceTypes.d.ts
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
User
|
|
3
|
-
} from "./manageTypes.js";
|
|
1
|
+
import type { User } from "./manageTypes.js";
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
|
-
* This interface represents a labeled portion of the price for goods or services.
|
|
7
|
-
*/
|
|
4
|
+
* This interface represents a labeled portion of the price for goods or services.
|
|
5
|
+
*/
|
|
8
6
|
export interface LabeledPrice {
|
|
9
7
|
/** The label of the portion. */
|
|
10
8
|
label: string;
|
|
11
9
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
*/
|
|
17
15
|
amount: number;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
/**
|
|
21
|
-
* This interface contains basic information about an invoice.
|
|
22
|
-
*/
|
|
19
|
+
* This interface contains basic information about an invoice.
|
|
20
|
+
*/
|
|
23
21
|
export interface Invoice {
|
|
24
22
|
/** The name of the product. */
|
|
25
23
|
title: string;
|
|
@@ -30,17 +28,17 @@ export interface Invoice {
|
|
|
30
28
|
/** The three-letter ISO 4217 currency code. */
|
|
31
29
|
currency: string;
|
|
32
30
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
+
*/
|
|
38
36
|
total_amount: number;
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
/**
|
|
42
|
-
* This interface represents a shipping address.
|
|
43
|
-
*/
|
|
40
|
+
* This interface represents a shipping address.
|
|
41
|
+
*/
|
|
44
42
|
export interface ShippingAddress {
|
|
45
43
|
/** The two-letter ISO 3166-1 alpha-2 country code. */
|
|
46
44
|
country_code: string;
|
|
@@ -57,8 +55,8 @@ export interface ShippingAddress {
|
|
|
57
55
|
}
|
|
58
56
|
|
|
59
57
|
/**
|
|
60
|
-
* This interface represents information about an order.
|
|
61
|
-
*/
|
|
58
|
+
* This interface represents information about an order.
|
|
59
|
+
*/
|
|
62
60
|
export interface OrderInfo {
|
|
63
61
|
/** The user's name. */
|
|
64
62
|
name?: string;
|
|
@@ -71,8 +69,8 @@ export interface OrderInfo {
|
|
|
71
69
|
}
|
|
72
70
|
|
|
73
71
|
/**
|
|
74
|
-
* This interface represents a shipping option.
|
|
75
|
-
*/
|
|
72
|
+
* This interface represents a shipping option.
|
|
73
|
+
*/
|
|
76
74
|
export interface ShippingOption {
|
|
77
75
|
/** The shipping option identifier. */
|
|
78
76
|
id: string;
|
|
@@ -83,17 +81,17 @@ export interface ShippingOption {
|
|
|
83
81
|
}
|
|
84
82
|
|
|
85
83
|
/**
|
|
86
|
-
* This interface contains basic information about a successful payment.
|
|
87
|
-
*/
|
|
84
|
+
* This interface contains basic information about a successful payment.
|
|
85
|
+
*/
|
|
88
86
|
export interface SuccessfulPayment {
|
|
89
87
|
/** The three-letter ISO 4217 currency code. */
|
|
90
88
|
currency: string;
|
|
91
89
|
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
+
*/
|
|
97
95
|
total_amount: number;
|
|
98
96
|
/** The bot-specified invoice payload. */
|
|
99
97
|
invoice_payload: string;
|
|
@@ -104,14 +102,12 @@ export interface SuccessfulPayment {
|
|
|
104
102
|
/** The Telegram payment identifier. */
|
|
105
103
|
telegram_payment_charge_id: string;
|
|
106
104
|
/** The provider payment identifier. */
|
|
107
|
-
provider_payment_charge_id:
|
|
108
|
-
|
|
109
|
-
string;
|
|
105
|
+
provider_payment_charge_id: string;
|
|
110
106
|
}
|
|
111
107
|
|
|
112
108
|
/**
|
|
113
|
-
* This interface contains information about an incoming shipping query.
|
|
114
|
-
*/
|
|
109
|
+
* This interface contains information about an incoming shipping query.
|
|
110
|
+
*/
|
|
115
111
|
export interface ShippingQuery {
|
|
116
112
|
/** The unique query identifier. */
|
|
117
113
|
id: string;
|
|
@@ -124,8 +120,8 @@ export interface ShippingQuery {
|
|
|
124
120
|
}
|
|
125
121
|
|
|
126
122
|
/**
|
|
127
|
-
* This interface contains information about an incoming pre-checkout query.
|
|
128
|
-
*/
|
|
123
|
+
* This interface contains information about an incoming pre-checkout query.
|
|
124
|
+
*/
|
|
129
125
|
export interface PreCheckoutQuery {
|
|
130
126
|
/** The unique query identifier. */
|
|
131
127
|
id: string;
|
|
@@ -134,11 +130,11 @@ export interface PreCheckoutQuery {
|
|
|
134
130
|
/** The three-letter ISO 4217 currency code. */
|
|
135
131
|
currency: string;
|
|
136
132
|
/**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
+
*/
|
|
142
138
|
total_amount: number;
|
|
143
139
|
/** The bot-specified invoice payload. */
|
|
144
140
|
invoice_payload: string;
|
|
@@ -146,4 +142,4 @@ export interface PreCheckoutQuery {
|
|
|
146
142
|
shipping_option_id?: string;
|
|
147
143
|
/** The order information provided by the user. */
|
|
148
144
|
order_info?: OrderInfo;
|
|
149
|
-
}
|
|
145
|
+
}
|
package/src/manageTypes.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
Message,
|
|
4
|
-
PhotoSize
|
|
5
|
-
} from "./messageTypes.js";
|
|
6
|
-
import type {
|
|
7
|
-
Update
|
|
8
|
-
} from "./updateTypes.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 */
|
|
@@ -17,16 +11,15 @@ export interface WebhookInfo {
|
|
|
17
11
|
/** Currently used webhook IP address */
|
|
18
12
|
ip_address?: string;
|
|
19
13
|
/** Unix time for the most recent error that happened when trying to deliver an update via webhook */
|
|
20
|
-
last_error_date
|
|
14
|
+
last_error_date?: number;
|
|
21
15
|
/** Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook */
|
|
22
|
-
last_error_message
|
|
16
|
+
last_error_message?: string;
|
|
23
17
|
/** Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters */
|
|
24
18
|
last_synchronization_error_date?: number;
|
|
25
19
|
/** The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */
|
|
26
|
-
max_connections
|
|
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
|
|
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
|
+
}
|