@im-more/dsh-telegram 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/cordis.patch.yml +10 -0
- package/lib/index.js +2067 -0
- package/lib/index.js.map +1 -0
- package/lib/types/bot.d.ts +70 -0
- package/lib/types/bot.d.ts.map +1 -0
- package/lib/types/bot.js +231 -0
- package/lib/types/bot.js.map +1 -0
- package/lib/types/config.d.ts +34 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/config.js +41 -0
- package/lib/types/config.js.map +1 -0
- package/lib/types/decode.d.ts +39 -0
- package/lib/types/decode.d.ts.map +1 -0
- package/lib/types/decode.js +382 -0
- package/lib/types/decode.js.map +1 -0
- package/lib/types/errors.d.ts +33 -0
- package/lib/types/errors.d.ts.map +1 -0
- package/lib/types/errors.js +89 -0
- package/lib/types/errors.js.map +1 -0
- package/lib/types/identity.d.ts +19 -0
- package/lib/types/identity.d.ts.map +1 -0
- package/lib/types/identity.js +34 -0
- package/lib/types/identity.js.map +1 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +8 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/media.d.ts +38 -0
- package/lib/types/media.d.ts.map +1 -0
- package/lib/types/media.js +65 -0
- package/lib/types/media.js.map +1 -0
- package/lib/types/modes/html.d.ts +16 -0
- package/lib/types/modes/html.d.ts.map +1 -0
- package/lib/types/modes/html.js +155 -0
- package/lib/types/modes/html.js.map +1 -0
- package/lib/types/modes/plain.d.ts +14 -0
- package/lib/types/modes/plain.d.ts.map +1 -0
- package/lib/types/modes/plain.js +56 -0
- package/lib/types/modes/plain.js.map +1 -0
- package/lib/types/modes/shared.d.ts +140 -0
- package/lib/types/modes/shared.d.ts.map +1 -0
- package/lib/types/modes/shared.js +405 -0
- package/lib/types/modes/shared.js.map +1 -0
- package/lib/types/polling.d.ts +26 -0
- package/lib/types/polling.d.ts.map +1 -0
- package/lib/types/polling.js +149 -0
- package/lib/types/polling.js.map +1 -0
- package/lib/types/request.d.ts +67 -0
- package/lib/types/request.d.ts.map +1 -0
- package/lib/types/request.js +158 -0
- package/lib/types/request.js.map +1 -0
- package/lib/types/secret.d.ts +27 -0
- package/lib/types/secret.d.ts.map +1 -0
- package/lib/types/secret.js +39 -0
- package/lib/types/secret.js.map +1 -0
- package/lib/types/send.d.ts +48 -0
- package/lib/types/send.d.ts.map +1 -0
- package/lib/types/send.js +326 -0
- package/lib/types/send.js.map +1 -0
- package/lib/types/types/game.d.ts +102 -0
- package/lib/types/types/game.d.ts.map +1 -0
- package/lib/types/types/game.js +5 -0
- package/lib/types/types/game.js.map +1 -0
- package/lib/types/types/index.d.ts +2751 -0
- package/lib/types/types/index.d.ts.map +1 -0
- package/lib/types/types/index.js +88 -0
- package/lib/types/types/index.js.map +1 -0
- package/lib/types/types/inline.d.ts +796 -0
- package/lib/types/types/inline.d.ts.map +1 -0
- package/lib/types/types/inline.js +4 -0
- package/lib/types/types/inline.js.map +1 -0
- package/lib/types/types/internal.d.ts +32 -0
- package/lib/types/types/internal.d.ts.map +1 -0
- package/lib/types/types/internal.js +30 -0
- package/lib/types/types/internal.js.map +1 -0
- package/lib/types/types/passport.d.ts +229 -0
- package/lib/types/types/passport.d.ts.map +1 -0
- package/lib/types/types/passport.js +3 -0
- package/lib/types/types/passport.js.map +1 -0
- package/lib/types/types/payment.d.ts +285 -0
- package/lib/types/types/payment.d.ts.map +1 -0
- package/lib/types/types/payment.js +6 -0
- package/lib/types/types/payment.js.map +1 -0
- package/lib/types/types/sticker.d.ts +221 -0
- package/lib/types/types/sticker.d.ts.map +1 -0
- package/lib/types/types/sticker.js +11 -0
- package/lib/types/types/sticker.js.map +1 -0
- package/lib/types/types/update.d.ts +97 -0
- package/lib/types/types/update.d.ts.map +1 -0
- package/lib/types/types/update.js +6 -0
- package/lib/types/types/update.js.map +1 -0
- package/lib/types/webhook.d.ts +29 -0
- package/lib/types/webhook.d.ts.map +1 -0
- package/lib/types/webhook.js +129 -0
- package/lib/types/webhook.js.map +1 -0
- package/package.json +61 -3
- package/src/bot.ts +349 -0
- package/src/config.ts +73 -0
- package/src/decode.ts +472 -0
- package/src/errors.ts +103 -0
- package/src/identity.ts +41 -0
- package/src/index.ts +14 -0
- package/src/media.ts +79 -0
- package/src/modes/html.ts +193 -0
- package/src/modes/plain.ts +75 -0
- package/src/modes/shared.ts +505 -0
- package/src/polling.ts +176 -0
- package/src/request.ts +224 -0
- package/src/secret.ts +46 -0
- package/src/send.ts +454 -0
- package/src/types/.eslintrc.yml +2 -0
- package/src/types/game.ts +112 -0
- package/src/types/index.ts +3028 -0
- package/src/types/inline.ts +857 -0
- package/src/types/internal.ts +64 -0
- package/src/types/passport.ts +256 -0
- package/src/types/payment.ts +304 -0
- package/src/types/sticker.ts +244 -0
- package/src/types/update.ts +107 -0
- package/src/webhook.ts +168 -0
- package/README.md +0 -3
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { InlineKeyboardMarkup, Integer, Message, User } from './index.ts';
|
|
2
|
+
export interface SendInvoicePayload {
|
|
3
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
4
|
+
chat_id?: Integer | string;
|
|
5
|
+
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
6
|
+
message_thread_id?: number;
|
|
7
|
+
/** Product name, 1-32 characters */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** Product description, 1-255 characters */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
|
|
12
|
+
payload?: string;
|
|
13
|
+
/** Payments provider token, obtained via Botfather */
|
|
14
|
+
provider_token?: string;
|
|
15
|
+
/** Three-letter ISO 4217 currency code, see more on currencies */
|
|
16
|
+
currency?: string;
|
|
17
|
+
/** Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
|
|
18
|
+
prices?: LabeledPrice[];
|
|
19
|
+
/** 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 */
|
|
20
|
+
max_tip_amount?: Integer;
|
|
21
|
+
/** A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. */
|
|
22
|
+
suggested_tip_amounts?: Integer[];
|
|
23
|
+
/** Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter */
|
|
24
|
+
start_parameter?: string;
|
|
25
|
+
/** A JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. */
|
|
26
|
+
provider_data?: string;
|
|
27
|
+
/** URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. */
|
|
28
|
+
photo_url?: string;
|
|
29
|
+
/** Photo size */
|
|
30
|
+
photo_size?: Integer;
|
|
31
|
+
/** Photo width */
|
|
32
|
+
photo_width?: Integer;
|
|
33
|
+
/** Photo height */
|
|
34
|
+
photo_height?: Integer;
|
|
35
|
+
/** Pass True, if you require the user's full name to complete the order */
|
|
36
|
+
need_name?: boolean;
|
|
37
|
+
/** Pass True, if you require the user's phone number to complete the order */
|
|
38
|
+
need_phone_number?: boolean;
|
|
39
|
+
/** Pass True, if you require the user's email address to complete the order */
|
|
40
|
+
need_email?: boolean;
|
|
41
|
+
/** Pass True, if you require the user's shipping address to complete the order */
|
|
42
|
+
need_shipping_address?: boolean;
|
|
43
|
+
/** Pass True, if user's phone number should be sent to provider */
|
|
44
|
+
send_phone_number_to_provider?: boolean;
|
|
45
|
+
/** Pass True, if user's email address should be sent to provider */
|
|
46
|
+
send_email_to_provider?: boolean;
|
|
47
|
+
/** Pass True, if the final price depends on the shipping method */
|
|
48
|
+
is_flexible?: boolean;
|
|
49
|
+
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
50
|
+
disable_notification?: boolean;
|
|
51
|
+
/** Protects the contents of the sent message from forwarding and saving */
|
|
52
|
+
protect_content?: boolean;
|
|
53
|
+
/** If the message is a reply, ID of the original message */
|
|
54
|
+
reply_to_message_id?: Integer;
|
|
55
|
+
/** Pass True, if the message should be sent even if the specified replied-to message is not found */
|
|
56
|
+
allow_sending_without_reply?: boolean;
|
|
57
|
+
/** A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button. */
|
|
58
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
59
|
+
}
|
|
60
|
+
export interface CreateInvoiceLinkPayload {
|
|
61
|
+
/** Product name, 1-32 characters */
|
|
62
|
+
title: string;
|
|
63
|
+
/** Product description, 1-255 characters */
|
|
64
|
+
description: string;
|
|
65
|
+
/** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
|
|
66
|
+
payload: string;
|
|
67
|
+
/** Payment provider token, obtained via BotFather */
|
|
68
|
+
provider_token: string;
|
|
69
|
+
/** Three-letter ISO 4217 currency code, see more on currencies */
|
|
70
|
+
currency: string;
|
|
71
|
+
/** Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
|
|
72
|
+
prices: LabeledPrice[];
|
|
73
|
+
/** 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 */
|
|
74
|
+
max_tip_amount?: number;
|
|
75
|
+
/** A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. */
|
|
76
|
+
suggested_tip_amounts?: number[];
|
|
77
|
+
/** JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. */
|
|
78
|
+
provider_data?: string;
|
|
79
|
+
/** URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. */
|
|
80
|
+
photo_url?: string;
|
|
81
|
+
/** Photo size in bytes */
|
|
82
|
+
photo_size?: number;
|
|
83
|
+
/** Photo width */
|
|
84
|
+
photo_width?: number;
|
|
85
|
+
/** Photo height */
|
|
86
|
+
photo_height?: number;
|
|
87
|
+
/** Pass True if you require the user's full name to complete the order */
|
|
88
|
+
need_name?: boolean;
|
|
89
|
+
/** Pass True if you require the user's phone number to complete the order */
|
|
90
|
+
need_phone_number?: boolean;
|
|
91
|
+
/** Pass True if you require the user's email address to complete the order */
|
|
92
|
+
need_email?: boolean;
|
|
93
|
+
/** Pass True if you require the user's shipping address to complete the order */
|
|
94
|
+
need_shipping_address?: boolean;
|
|
95
|
+
/** Pass True if the user's phone number should be sent to the provider */
|
|
96
|
+
send_phone_number_to_provider?: boolean;
|
|
97
|
+
/** Pass True if the user's email address should be sent to the provider */
|
|
98
|
+
send_email_to_provider?: boolean;
|
|
99
|
+
/** Pass True if the final price depends on the shipping method */
|
|
100
|
+
is_flexible?: boolean;
|
|
101
|
+
}
|
|
102
|
+
export interface AnswerShippingQueryPayload {
|
|
103
|
+
/** Unique identifier for the query to be answered */
|
|
104
|
+
shipping_query_id?: string;
|
|
105
|
+
/** Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible) */
|
|
106
|
+
ok?: boolean;
|
|
107
|
+
/** Required if ok is True. A JSON-serialized array of available shipping options. */
|
|
108
|
+
shipping_options?: ShippingOption[];
|
|
109
|
+
/** Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user. */
|
|
110
|
+
error_message?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface AnswerPreCheckoutQueryPayload {
|
|
113
|
+
/** Unique identifier for the query to be answered */
|
|
114
|
+
pre_checkout_query_id?: string;
|
|
115
|
+
/** Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems. */
|
|
116
|
+
ok?: boolean;
|
|
117
|
+
/** Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. */
|
|
118
|
+
error_message?: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* This object represents a portion of the price for goods or services.
|
|
122
|
+
* @see https://core.telegram.org/bots/api#labeledprice
|
|
123
|
+
*/
|
|
124
|
+
export interface LabeledPrice {
|
|
125
|
+
/** Portion label */
|
|
126
|
+
label?: string;
|
|
127
|
+
/** Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass 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). */
|
|
128
|
+
amount?: Integer;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* This object contains basic information about an invoice.
|
|
132
|
+
* @see https://core.telegram.org/bots/api#invoice
|
|
133
|
+
*/
|
|
134
|
+
export interface Invoice {
|
|
135
|
+
/** Product name */
|
|
136
|
+
title?: string;
|
|
137
|
+
/** Product description */
|
|
138
|
+
description?: string;
|
|
139
|
+
/** Unique bot deep-linking parameter that can be used to generate this invoice */
|
|
140
|
+
start_parameter?: string;
|
|
141
|
+
/** Three-letter ISO 4217 currency code */
|
|
142
|
+
currency?: string;
|
|
143
|
+
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass 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). */
|
|
144
|
+
total_amount?: Integer;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* This object represents a shipping address.
|
|
148
|
+
* @see https://core.telegram.org/bots/api#shippingaddress
|
|
149
|
+
*/
|
|
150
|
+
export interface ShippingAddress {
|
|
151
|
+
/** ISO 3166-1 alpha-2 country code */
|
|
152
|
+
country_code?: string;
|
|
153
|
+
/** State, if applicable */
|
|
154
|
+
state?: string;
|
|
155
|
+
/** City */
|
|
156
|
+
city?: string;
|
|
157
|
+
/** First line for the address */
|
|
158
|
+
street_line1?: string;
|
|
159
|
+
/** Second line for the address */
|
|
160
|
+
street_line2?: string;
|
|
161
|
+
/** Address post code */
|
|
162
|
+
post_code?: string;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* This object represents information about an order.
|
|
166
|
+
* @see https://core.telegram.org/bots/api#orderinfo
|
|
167
|
+
*/
|
|
168
|
+
export interface OrderInfo {
|
|
169
|
+
/** Optional. User name */
|
|
170
|
+
name?: string;
|
|
171
|
+
/** Optional. User's phone number */
|
|
172
|
+
phone_number?: string;
|
|
173
|
+
/** Optional. User email */
|
|
174
|
+
email?: string;
|
|
175
|
+
/** Optional. User shipping address */
|
|
176
|
+
shipping_address?: ShippingAddress;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* This object represents one shipping option.
|
|
180
|
+
* @see https://core.telegram.org/bots/api#shippingoption
|
|
181
|
+
*/
|
|
182
|
+
export interface ShippingOption {
|
|
183
|
+
/** Shipping option identifier */
|
|
184
|
+
id?: string;
|
|
185
|
+
/** Option title */
|
|
186
|
+
title?: string;
|
|
187
|
+
/** List of price portions */
|
|
188
|
+
prices?: LabeledPrice[];
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* This object contains basic information about a successful payment.
|
|
192
|
+
* @see https://core.telegram.org/bots/api#successfulpayment
|
|
193
|
+
*/
|
|
194
|
+
export interface SuccessfulPayment {
|
|
195
|
+
/** Three-letter ISO 4217 currency code */
|
|
196
|
+
currency?: string;
|
|
197
|
+
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass 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). */
|
|
198
|
+
total_amount?: Integer;
|
|
199
|
+
/** Bot specified invoice payload */
|
|
200
|
+
invoice_payload?: string;
|
|
201
|
+
/** Optional. Identifier of the shipping option chosen by the user */
|
|
202
|
+
shipping_option_id?: string;
|
|
203
|
+
/** Optional. Order info provided by the user */
|
|
204
|
+
order_info?: OrderInfo;
|
|
205
|
+
/** Telegram payment identifier */
|
|
206
|
+
telegram_payment_charge_id?: string;
|
|
207
|
+
/** Provider payment identifier */
|
|
208
|
+
provider_payment_charge_id?: string;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* This object contains information about an incoming shipping query.
|
|
212
|
+
* @see https://core.telegram.org/bots/api#shippingquery
|
|
213
|
+
*/
|
|
214
|
+
export interface ShippingQuery {
|
|
215
|
+
/** Unique query identifier */
|
|
216
|
+
id?: string;
|
|
217
|
+
/** User who sent the query */
|
|
218
|
+
from?: User;
|
|
219
|
+
/** Bot specified invoice payload */
|
|
220
|
+
invoice_payload?: string;
|
|
221
|
+
/** User specified shipping address */
|
|
222
|
+
shipping_address?: ShippingAddress;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* This object contains information about an incoming pre-checkout query.
|
|
226
|
+
* @see https://core.telegram.org/bots/api#precheckoutquery
|
|
227
|
+
*/
|
|
228
|
+
export interface PreCheckoutQuery {
|
|
229
|
+
/** Unique query identifier */
|
|
230
|
+
id?: string;
|
|
231
|
+
/** User who sent the query */
|
|
232
|
+
from?: User;
|
|
233
|
+
/** Three-letter ISO 4217 currency code */
|
|
234
|
+
currency?: string;
|
|
235
|
+
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass 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). */
|
|
236
|
+
total_amount?: Integer;
|
|
237
|
+
/** Bot specified invoice payload */
|
|
238
|
+
invoice_payload?: string;
|
|
239
|
+
/** Optional. Identifier of the shipping option chosen by the user */
|
|
240
|
+
shipping_option_id?: string;
|
|
241
|
+
/** Optional. Order info provided by the user */
|
|
242
|
+
order_info?: OrderInfo;
|
|
243
|
+
}
|
|
244
|
+
declare module './index.ts' {
|
|
245
|
+
interface Message {
|
|
246
|
+
/** Optional. Message is an invoice for a payment, information about the invoice. More about payments » */
|
|
247
|
+
invoice?: Invoice;
|
|
248
|
+
/** Optional. Message is a service message about a successful payment, information about the payment. More about payments » */
|
|
249
|
+
successful_payment?: SuccessfulPayment;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
declare module './update.ts' {
|
|
253
|
+
interface Update {
|
|
254
|
+
/** Optional. New incoming shipping query. Only for invoices with flexible price */
|
|
255
|
+
shipping_query?: ShippingQuery;
|
|
256
|
+
/** Optional. New incoming pre-checkout query. Contains full information about checkout */
|
|
257
|
+
pre_checkout_query?: PreCheckoutQuery;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
declare module './internal.ts' {
|
|
261
|
+
interface Internal {
|
|
262
|
+
/**
|
|
263
|
+
* Use this method to send invoices. On success, the sent Message is returned.
|
|
264
|
+
* @see https://core.telegram.org/bots/api#sendinvoice
|
|
265
|
+
*/
|
|
266
|
+
sendInvoice(payload: SendInvoicePayload): Promise<Message>;
|
|
267
|
+
/**
|
|
268
|
+
* Use this method to create a link for an invoice. Returns the created invoice link as String on success.
|
|
269
|
+
* @see https://core.telegram.org/bots/api#createinvoicelink
|
|
270
|
+
*/
|
|
271
|
+
createInvoiceLink(payload: CreateInvoiceLinkPayload): Promise<string>;
|
|
272
|
+
/**
|
|
273
|
+
* If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
|
|
274
|
+
* @see https://core.telegram.org/bots/api#answershippingquery
|
|
275
|
+
*/
|
|
276
|
+
answerShippingQuery(payload: AnswerShippingQueryPayload): Promise<boolean>;
|
|
277
|
+
/**
|
|
278
|
+
* Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned.
|
|
279
|
+
* Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
|
|
280
|
+
* @see https://core.telegram.org/bots/api#answerprecheckoutquery
|
|
281
|
+
*/
|
|
282
|
+
answerPreCheckoutQuery(payload: AnswerPreCheckoutQueryPayload): Promise<boolean>;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
//# sourceMappingURL=payment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../src/types/payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAY,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEnF,MAAM,WAAW,kBAAkB;IACjC,+GAA+G;IAC/G,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC1B,uGAAuG;IACvG,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yHAAyH;IACzH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sDAAsD;IACtD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,0IAA0I;IAC1I,MAAM,CAAC,EAAE,YAAY,EAAE,CAAA;IACvB,uVAAuV;IACvV,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,qSAAqS;IACrS,qBAAqB,CAAC,EAAE,OAAO,EAAE,CAAA;IACjC,yXAAyX;IACzX,eAAe,CAAC,EAAE,MAA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aAAa,CAAA;QAC9B,0FAA0F;QAC1F,kBAAkB,CAAC,EAAE,gBAAgB,CAAA;KACtC;CACF;AAED,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,QAAQ;QAChB;;;WAGG;QACH,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAC1D;;;WAGG;QACH,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;QACrE;;;WAGG;QACH,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAC1E;;;;WAIG;QACH,sBAAsB,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;KACjF;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/types/payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,QAAQ,EAAiB,MAAM,YAAY,CAAA;AA4SnF,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;AAC9B,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAA;AACpC,QAAQ,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAA;AACtC,QAAQ,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAA"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { File, Float, ForceReply, InlineKeyboardMarkup, InputFile, Integer, Message, PhotoSize, ReplyKeyboardMarkup, ReplyKeyboardRemove } from './index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* This object represents a sticker.
|
|
4
|
+
* @see https://core.telegram.org/bots/api#sticker
|
|
5
|
+
*/
|
|
6
|
+
export interface Sticker {
|
|
7
|
+
/** Identifier for this file, which can be used to download or reuse the file */
|
|
8
|
+
file_id?: string;
|
|
9
|
+
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
|
|
10
|
+
file_unique_id?: string;
|
|
11
|
+
/** Sticker width */
|
|
12
|
+
width?: Integer;
|
|
13
|
+
/** Sticker height */
|
|
14
|
+
height?: Integer;
|
|
15
|
+
/** True, if the sticker is animated */
|
|
16
|
+
is_animated?: boolean;
|
|
17
|
+
/** True, if the sticker is a video sticker */
|
|
18
|
+
is_video?: boolean;
|
|
19
|
+
/** Optional. Sticker thumbnail in the .WEBP or .JPG format */
|
|
20
|
+
thumb?: PhotoSize;
|
|
21
|
+
/** Optional. Sticker thumbnail in the .WEBP or .JPG format (renamed from `thumb`) */
|
|
22
|
+
thumbnail?: PhotoSize;
|
|
23
|
+
/** Optional. Emoji associated with the sticker */
|
|
24
|
+
emoji?: string;
|
|
25
|
+
/** Optional. Name of the sticker set to which the sticker belongs */
|
|
26
|
+
set_name?: string;
|
|
27
|
+
/** Optional. For premium regular stickers, premium animation for the sticker */
|
|
28
|
+
premium_animation?: File;
|
|
29
|
+
/** Optional. For mask stickers, the position where the mask should be placed */
|
|
30
|
+
mask_position?: MaskPosition;
|
|
31
|
+
/** Optional. For custom emoji stickers, unique identifier of the custom emoji */
|
|
32
|
+
custom_emoji_id?: string;
|
|
33
|
+
/** Optional. File size in bytes */
|
|
34
|
+
file_size?: Integer;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* This object represents a sticker set.
|
|
38
|
+
* @see https://core.telegram.org/bots/api#stickerset
|
|
39
|
+
*/
|
|
40
|
+
export interface StickerSet {
|
|
41
|
+
/** Sticker set name */
|
|
42
|
+
name?: string;
|
|
43
|
+
/** Sticker set title */
|
|
44
|
+
title?: string;
|
|
45
|
+
/** Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” */
|
|
46
|
+
sticker_type: string;
|
|
47
|
+
/** True, if the sticker set contains animated stickers */
|
|
48
|
+
is_animated?: boolean;
|
|
49
|
+
/** True, if the sticker set contains video stickers */
|
|
50
|
+
is_video?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* True, if the sticker set contains masks
|
|
53
|
+
* @deprecated
|
|
54
|
+
*/
|
|
55
|
+
contains_masks?: boolean;
|
|
56
|
+
/** List of all set stickers */
|
|
57
|
+
stickers?: Sticker[];
|
|
58
|
+
/** Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format */
|
|
59
|
+
thumb?: PhotoSize;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* This object describes the position on faces where a mask should be placed by default.
|
|
63
|
+
* @see https://core.telegram.org/bots/api#maskposition
|
|
64
|
+
*/
|
|
65
|
+
export interface MaskPosition {
|
|
66
|
+
/** The part of the face relative to which the mask should be placed. One of "forehead", "eyes", "mouth", or "chin". */
|
|
67
|
+
point?: string;
|
|
68
|
+
/** Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. */
|
|
69
|
+
x_shift?: Float;
|
|
70
|
+
/** Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. */
|
|
71
|
+
y_shift?: Float;
|
|
72
|
+
/** Mask scaling coefficient. For example, 2.0 means double size. */
|
|
73
|
+
scale?: Float;
|
|
74
|
+
}
|
|
75
|
+
export interface SendStickerPayload {
|
|
76
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
77
|
+
chat_id?: Integer | string;
|
|
78
|
+
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
79
|
+
message_thread_id?: number;
|
|
80
|
+
/** 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 file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files » */
|
|
81
|
+
sticker?: InputFile | string;
|
|
82
|
+
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
83
|
+
disable_notification?: boolean;
|
|
84
|
+
/** Protects the contents of the sent message from forwarding and saving */
|
|
85
|
+
protect_content?: boolean;
|
|
86
|
+
/** If the message is a reply, ID of the original message */
|
|
87
|
+
reply_to_message_id?: Integer;
|
|
88
|
+
/** Pass True, if the message should be sent even if the specified replied-to message is not found */
|
|
89
|
+
allow_sending_without_reply?: boolean;
|
|
90
|
+
/** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
|
|
91
|
+
reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
92
|
+
}
|
|
93
|
+
export interface GetStickerSetPayload {
|
|
94
|
+
/** Name of the sticker set */
|
|
95
|
+
name?: string;
|
|
96
|
+
}
|
|
97
|
+
export interface GetCustomEmojiStickersPayload {
|
|
98
|
+
/** List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. */
|
|
99
|
+
custom_emoji_ids: string[];
|
|
100
|
+
}
|
|
101
|
+
export interface UploadStickerFilePayload {
|
|
102
|
+
/** User identifier of sticker file owner */
|
|
103
|
+
user_id?: Integer;
|
|
104
|
+
/** PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. More info on Sending Files » */
|
|
105
|
+
png_sticker?: InputFile;
|
|
106
|
+
}
|
|
107
|
+
export interface CreateNewStickerSetPayload {
|
|
108
|
+
/** User identifier of created sticker set owner */
|
|
109
|
+
user_id?: Integer;
|
|
110
|
+
/** Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in "by<bot username>". <bot_username> is case insensitive. 1-64 characters. */
|
|
111
|
+
name?: string;
|
|
112
|
+
/** Sticker set title, 1-64 characters */
|
|
113
|
+
title?: string;
|
|
114
|
+
/** PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, 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. More info on Sending Files » */
|
|
115
|
+
png_sticker?: InputFile | string;
|
|
116
|
+
/** TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#animated-sticker-requirements for technical requirements */
|
|
117
|
+
tgs_sticker?: InputFile;
|
|
118
|
+
/** WEBM video with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#video-sticker-requirements for technical requirements */
|
|
119
|
+
webm_sticker?: InputFile;
|
|
120
|
+
/** Type of stickers in the set, pass “regular” or “mask”. Custom emoji sticker sets can't be created via the Bot API at the moment. By default, a regular sticker set is created. */
|
|
121
|
+
sticker_type?: string;
|
|
122
|
+
/** One or more emoji corresponding to the sticker */
|
|
123
|
+
emojis?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Pass True, if a set of mask stickers should be created
|
|
126
|
+
* @deprecated
|
|
127
|
+
*/
|
|
128
|
+
contains_masks?: boolean;
|
|
129
|
+
/** A JSON-serialized object for position where the mask should be placed on faces */
|
|
130
|
+
mask_position?: MaskPosition;
|
|
131
|
+
}
|
|
132
|
+
export interface AddStickerToSetPayload {
|
|
133
|
+
/** User identifier of sticker set owner */
|
|
134
|
+
user_id?: Integer;
|
|
135
|
+
/** Sticker set name */
|
|
136
|
+
name?: string;
|
|
137
|
+
/** PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, 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. More info on Sending Files » */
|
|
138
|
+
png_sticker?: InputFile | string;
|
|
139
|
+
/** TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#animated-sticker-requirements for technical requirements */
|
|
140
|
+
tgs_sticker?: InputFile;
|
|
141
|
+
/** WEBM video with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#video-sticker-requirements for technical requirements */
|
|
142
|
+
webm_sticker?: InputFile;
|
|
143
|
+
/** One or more emoji corresponding to the sticker */
|
|
144
|
+
emojis?: string;
|
|
145
|
+
/** A JSON-serialized object for position where the mask should be placed on faces */
|
|
146
|
+
mask_position?: MaskPosition;
|
|
147
|
+
}
|
|
148
|
+
export interface SetStickerPositionInSetPayload {
|
|
149
|
+
/** File identifier of the sticker */
|
|
150
|
+
sticker?: string;
|
|
151
|
+
/** New sticker position in the set, zero-based */
|
|
152
|
+
position?: Integer;
|
|
153
|
+
}
|
|
154
|
+
export interface DeleteStickerFromSetPayload {
|
|
155
|
+
/** File identifier of the sticker */
|
|
156
|
+
sticker?: string;
|
|
157
|
+
}
|
|
158
|
+
export interface SetStickerSetThumbPayload {
|
|
159
|
+
/** Sticker set name */
|
|
160
|
+
name?: string;
|
|
161
|
+
/** User identifier of the sticker set owner */
|
|
162
|
+
user_id?: Integer;
|
|
163
|
+
/** A PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS animation with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#animated-sticker-requirements for animated sticker technical requirements, or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-sticker-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, 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. More info on Sending Files ». Animated sticker set thumbnails can't be uploaded via HTTP URL. */
|
|
164
|
+
thumb?: InputFile | string;
|
|
165
|
+
}
|
|
166
|
+
declare module './index.ts' {
|
|
167
|
+
interface Message {
|
|
168
|
+
/** Optional. Message is a sticker, information about the sticker */
|
|
169
|
+
sticker?: Sticker;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
declare module './internal.ts' {
|
|
173
|
+
interface Internal {
|
|
174
|
+
/**
|
|
175
|
+
* Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.
|
|
176
|
+
* @see https://core.telegram.org/bots/api#sendsticker
|
|
177
|
+
*/
|
|
178
|
+
sendSticker(payload: SendStickerPayload): Promise<Message>;
|
|
179
|
+
/**
|
|
180
|
+
* Use this method to get a sticker set. On success, a StickerSet object is returned.
|
|
181
|
+
* @see https://core.telegram.org/bots/api#getstickerset
|
|
182
|
+
*/
|
|
183
|
+
getStickerSet(payload: GetStickerSetPayload): Promise<StickerSet>;
|
|
184
|
+
/**
|
|
185
|
+
* Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.
|
|
186
|
+
* @see https://core.telegram.org/bots/api#getcustomemojistickers
|
|
187
|
+
*/
|
|
188
|
+
getCustomEmojiStickers(payload: GetCustomEmojiStickersPayload): Promise<Sticker[]>;
|
|
189
|
+
/**
|
|
190
|
+
* Use this method to upload a .PNG file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.
|
|
191
|
+
* @see https://core.telegram.org/bots/api#uploadstickerfile
|
|
192
|
+
*/
|
|
193
|
+
uploadStickerFile(payload: UploadStickerFilePayload): Promise<File>;
|
|
194
|
+
/**
|
|
195
|
+
* Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You must use exactly one of the fields png_sticker, tgs_sticker, or webm_sticker. Returns True on success.
|
|
196
|
+
* @see https://core.telegram.org/bots/api#createnewstickerset
|
|
197
|
+
*/
|
|
198
|
+
createNewStickerSet(payload: CreateNewStickerSetPayload): Promise<boolean>;
|
|
199
|
+
/**
|
|
200
|
+
* Use this method to add a new sticker to a set created by the bot. You must use exactly one of the fields png_sticker, tgs_sticker, or webm_sticker. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.
|
|
201
|
+
* @see https://core.telegram.org/bots/api#addstickertoset
|
|
202
|
+
*/
|
|
203
|
+
addStickerToSet(payload: AddStickerToSetPayload): Promise<boolean>;
|
|
204
|
+
/**
|
|
205
|
+
* Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.
|
|
206
|
+
* @see https://core.telegram.org/bots/api#setstickerpositioninset
|
|
207
|
+
*/
|
|
208
|
+
setStickerPositionInSet(payload: SetStickerPositionInSetPayload): Promise<boolean>;
|
|
209
|
+
/**
|
|
210
|
+
* Use this method to delete a sticker from a set created by the bot. Returns True on success.
|
|
211
|
+
* @see https://core.telegram.org/bots/api#deletestickerfromset
|
|
212
|
+
*/
|
|
213
|
+
deleteStickerFromSet(payload: DeleteStickerFromSetPayload): Promise<boolean>;
|
|
214
|
+
/**
|
|
215
|
+
* Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only. Returns True on success.
|
|
216
|
+
* @see https://core.telegram.org/bots/api#setstickersetthumb
|
|
217
|
+
*/
|
|
218
|
+
setStickerSetThumb(payload: SetStickerSetThumbPayload): Promise<boolean>;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=sticker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticker.d.ts","sourceRoot":"","sources":["../../../src/types/sticker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,OAAO,EAAY,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEtK;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,uJAAuJ;IACvJ,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,oBAAoB;IACpB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,qBAAqB;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,qFAAqF;IACrF,SAAS,CAAC,EAA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wB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;QACnE;;;WAGG;QACH,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAC1E;;;WAGG;QACH,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAClE;;;WAGG;QACH,uBAAuB,CAAC,OAAO,EAAE,8BAA8B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAClF;;;WAGG;QACH,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAC5E;;;WAGG;QACH,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;KACzE;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Internal } from "./index.js";
|
|
2
|
+
Internal.define('sendSticker');
|
|
3
|
+
Internal.define('getStickerSet');
|
|
4
|
+
Internal.define('getCustomEmojiStickers');
|
|
5
|
+
Internal.define('uploadStickerFile');
|
|
6
|
+
Internal.define('createNewStickerSet');
|
|
7
|
+
Internal.define('addStickerToSet');
|
|
8
|
+
Internal.define('setStickerPositionInSet');
|
|
9
|
+
Internal.define('deleteStickerFromSet');
|
|
10
|
+
Internal.define('setStickerSetThumb');
|
|
11
|
+
//# sourceMappingURL=sticker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticker.js","sourceRoot":"","sources":["../../../src/types/sticker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqE,QAAQ,EAAgE,MAAM,YAAY,CAAA;AA2OtK,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;AAC9B,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AAChC,QAAQ,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAA;AACzC,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAA;AACpC,QAAQ,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAA;AACtC,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAA;AAClC,QAAQ,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAA;AAC1C,QAAQ,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAA;AACvC,QAAQ,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAA"}
|