grammy 1.35.1 → 1.36.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/README.md +3 -2
- package/out/bot.js +1 -1
- package/out/context.d.ts +175 -3
- package/out/context.js +209 -1
- package/out/convenience/keyboard.d.ts +2 -2
- package/out/convenience/keyboard.js +2 -2
- package/out/core/api.d.ts +197 -5
- package/out/core/api.js +237 -4
- package/out/filter.d.ts +24 -0
- package/out/filter.js +4 -0
- package/out/types.node.d.ts +17 -1
- package/out/web.mjs +178 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<!-- deno-fmt-ignore-start -->
|
|
12
12
|
|
|
13
|
-
[](https://core.telegram.org/bots/api)
|
|
14
14
|
[](https://deno.land/x/grammy)
|
|
15
15
|
[](https://www.npmjs.org/package/grammy)
|
|
16
16
|
[](#contributors-)
|
|
@@ -307,7 +307,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
307
307
|
<td align="center" valign="top" width="11.11%"><a href="https://github.com/asologor"><img src="https://avatars.githubusercontent.com/u/97506048?v=4?s=100" width="100px;" alt="Andrew Sologor"/><br /><sub><b>Andrew Sologor</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Aandrew-sol" title="Reviewed Pull Requests">👀</a></td>
|
|
308
308
|
</tr>
|
|
309
309
|
<tr>
|
|
310
|
-
<td align="center" valign="top" width="11.11%"><a href="https://github.com/rayz1065"><img src="https://avatars.githubusercontent.com/u/37779815?v=4?s=100" width="100px;" alt="rayz"/><br /><sub><b>rayz</b></sub></a><br /><a href="#question-rayz1065" title="Answering Questions">💬</a> <a href="#ideas-rayz1065" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/grammyjs/grammY/commits?author=rayz1065" title="Code">💻</a></td>
|
|
310
|
+
<td align="center" valign="top" width="11.11%"><a href="https://github.com/rayz1065"><img src="https://avatars.githubusercontent.com/u/37779815?v=4?s=100" width="100px;" alt="rayz"/><br /><sub><b>rayz</b></sub></a><br /><a href="#question-rayz1065" title="Answering Questions">💬</a> <a href="#ideas-rayz1065" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/grammyjs/grammY/commits?author=rayz1065" title="Code">💻</a> <a href="https://github.com/grammyjs/grammY/commits?author=rayz1065" title="Documentation">📖</a></td>
|
|
311
311
|
<td align="center" valign="top" width="11.11%"><a href="https://github.com/z44d"><img src="https://avatars.githubusercontent.com/u/162994967?v=4?s=100" width="100px;" alt="Zaid"/><br /><sub><b>Zaid</b></sub></a><br /><a href="#tool-z44d" title="Tools">🔧</a></td>
|
|
312
312
|
<td align="center" valign="top" width="11.11%"><a href="https://github.com/matmilbury"><img src="https://avatars.githubusercontent.com/u/73319876?v=4?s=100" width="100px;" alt="Mat Milbury"/><br /><sub><b>Mat Milbury</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Amatmilbury" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=matmilbury" title="Code">💻</a></td>
|
|
313
313
|
<td align="center" valign="top" width="11.11%"><a href="https://lao.sb/"><img src="https://avatars.githubusercontent.com/u/2545261?v=4?s=100" width="100px;" alt="Shibo Lyu"/><br /><sub><b>Shibo Lyu</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=laosb" title="Code">💻</a></td>
|
|
@@ -326,6 +326,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
326
326
|
<td align="center" valign="top" width="11.11%"><a href="https://thadaw.com"><img src="https://avatars.githubusercontent.com/u/3647850?v=4?s=100" width="100px;" alt="Thada Wangthammang"/><br /><sub><b>Thada Wangthammang</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Amildronize" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=mildronize" title="Tests">⚠️</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Amildronize" title="Reviewed Pull Requests">👀</a></td>
|
|
327
327
|
<td align="center" valign="top" width="11.11%"><a href="https://github.com/rtyt3000"><img src="https://avatars.githubusercontent.com/u/123096124?v=4?s=100" width="100px;" alt="Konstantin Ryshkov"/><br /><sub><b>Konstantin Ryshkov</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Artyt3000" title="Bug reports">🐛</a></td>
|
|
328
328
|
<td align="center" valign="top" width="11.11%"><a href="https://github.com/mishkatik"><img src="https://avatars.githubusercontent.com/u/101044644?v=4?s=100" width="100px;" alt="mish"/><br /><sub><b>mish</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Amishkatik" title="Bug reports">🐛</a> <a href="https://github.com/grammyjs/grammY/commits?author=mishkatik" title="Code">💻</a></td>
|
|
329
|
+
<td align="center" valign="top" width="11.11%"><a href="https://github.com/eddienubes"><img src="https://avatars.githubusercontent.com/u/53977359?v=4?s=100" width="100px;" alt="Dmytro Tiapukhin"/><br /><sub><b>Dmytro Tiapukhin</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=eddienubes" title="Documentation">📖</a></td>
|
|
329
330
|
</tr>
|
|
330
331
|
</tbody>
|
|
331
332
|
</table>
|
package/out/bot.js
CHANGED
|
@@ -464,7 +464,7 @@ exports.Bot = Bot;
|
|
|
464
464
|
*
|
|
465
465
|
* Otherwise, if the first attempt at running the task fails, the task is
|
|
466
466
|
* retried immediately. If second attempt fails, too, waits for 100 ms, and then
|
|
467
|
-
* doubles this delay for every subsequent
|
|
467
|
+
* doubles this delay for every subsequent attempt. Never waits longer than 1
|
|
468
468
|
* hour before retrying.
|
|
469
469
|
*
|
|
470
470
|
* @param task Async task to perform
|
package/out/context.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Api, type Other as OtherApi } from "./core/api.js";
|
|
2
2
|
import { type Methods, type RawApi } from "./core/client.js";
|
|
3
3
|
import { type Filter, type FilterCore, type FilterQuery } from "./filter.js";
|
|
4
|
-
import { type Chat, type ChatPermissions, type InlineQueryResult, type InputFile, type InputMedia, type InputMediaAudio, type InputMediaDocument, type InputMediaPhoto, type InputMediaVideo, type InputPaidMedia, type InputPollOption, type LabeledPrice, type Message, type MessageEntity, type PassportElementError, type ReactionType, type ReactionTypeEmoji, type Update, type User, type UserFromGetMe } from "./types.js";
|
|
4
|
+
import { type AcceptedGiftTypes, type Chat, type ChatPermissions, type InlineQueryResult, type InputFile, type InputMedia, type InputMediaAudio, type InputMediaDocument, type InputMediaPhoto, type InputMediaVideo, type InputPaidMedia, type InputPollOption, type InputProfilePhoto, type InputStoryContent, type LabeledPrice, type Message, type MessageEntity, type PassportElementError, type ReactionType, type ReactionTypeEmoji, type Update, type User, type UserFromGetMe } from "./types.js";
|
|
5
5
|
export type MaybeArray<T> = T | T[];
|
|
6
6
|
/** permits `string` but gives hints */
|
|
7
7
|
export type StringWithCommandSuggestions = (string & Record<never, never>) | "start" | "help" | "settings" | "privacy" | "developer_info";
|
|
@@ -280,7 +280,7 @@ export declare class Context implements RenamedUpdate {
|
|
|
280
280
|
* ```ts
|
|
281
281
|
* ctx.entities() // Returns all entity types
|
|
282
282
|
* ctx.entities('url') // Returns only url entities
|
|
283
|
-
* ctx.
|
|
283
|
+
* ctx.entities(['url', 'email']) // Returns url and email entities
|
|
284
284
|
* ```
|
|
285
285
|
*
|
|
286
286
|
* @param types Types of entities to return. Omit to get all entities.
|
|
@@ -723,7 +723,7 @@ export declare class Context implements RenamedUpdate {
|
|
|
723
723
|
*/
|
|
724
724
|
getUserProfilePhotos(other?: Other<"getUserProfilePhotos", "user_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").UserProfilePhotos>;
|
|
725
725
|
/**
|
|
726
|
-
*
|
|
726
|
+
* Context-aware alias for `api.serUserEmojiStatus`. Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success.
|
|
727
727
|
*
|
|
728
728
|
* @param other Optional remaining parameters, confer the official reference below
|
|
729
729
|
* @param signal Optional `AbortSignal` to cancel the request
|
|
@@ -1304,6 +1304,159 @@ export declare class Context implements RenamedUpdate {
|
|
|
1304
1304
|
* **Official reference:** https://core.telegram.org/bots/api#deletemessages
|
|
1305
1305
|
*/
|
|
1306
1306
|
deleteMessages(message_ids: number[], signal?: AbortSignal): Promise<true>;
|
|
1307
|
+
/**
|
|
1308
|
+
* Context-aware alias for `api.deleteBusinessMessages`. Delete messages on behalf of a business account. Requires the can_delete_outgoing_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success.
|
|
1309
|
+
*
|
|
1310
|
+
* @param message_ids A list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted
|
|
1311
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1312
|
+
*
|
|
1313
|
+
* **Official reference:** https://core.telegram.org/bots/api#deletebusinessmessages
|
|
1314
|
+
*/
|
|
1315
|
+
deleteBusinessMessages(message_ids: number[], signal?: AbortSignal): Promise<true>;
|
|
1316
|
+
/**
|
|
1317
|
+
* Context-aware alias for `api.setBusinessAccountName`. Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.
|
|
1318
|
+
*
|
|
1319
|
+
* @param first_name The new value of the first name for the business account; 1-64 characters
|
|
1320
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1321
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1322
|
+
*
|
|
1323
|
+
* **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountname
|
|
1324
|
+
*/
|
|
1325
|
+
setBusinessAccountName(first_name: string, other: Other<"setBusinessAccountName", "business_connection_id" | "first_name">, signal?: AbortSignal): Promise<true>;
|
|
1326
|
+
/**
|
|
1327
|
+
* Context-aware alias for `api.setBusinessAccountUsername`. Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.
|
|
1328
|
+
*
|
|
1329
|
+
* @param username The new value of the username for the business account; 0-32 characters
|
|
1330
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1331
|
+
*
|
|
1332
|
+
* **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountusername
|
|
1333
|
+
*/
|
|
1334
|
+
setBusinessAccountUsername(username: string, signal?: AbortSignal): Promise<true>;
|
|
1335
|
+
/**
|
|
1336
|
+
* Context-aware alias for `api.setBusinessAccountBio`. Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success.
|
|
1337
|
+
*
|
|
1338
|
+
* @param bio The new value of the bio for the business account; 0-140 characters
|
|
1339
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1340
|
+
*
|
|
1341
|
+
* **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountbio
|
|
1342
|
+
*/
|
|
1343
|
+
setBusinessAccountBio(bio: string, signal?: AbortSignal): Promise<true>;
|
|
1344
|
+
/**
|
|
1345
|
+
* Context-aware alias for `api.setBusinessAccountProfilePhoto`. CsetBusinessAccountProfilePhotohanges the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.
|
|
1346
|
+
*
|
|
1347
|
+
* @param photo The new profile photo to set
|
|
1348
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1349
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1350
|
+
*
|
|
1351
|
+
* **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountprofilephoto
|
|
1352
|
+
*/
|
|
1353
|
+
setBusinessAccountProfilePhoto(photo: InputProfilePhoto, other: Other<"setBusinessAccountProfilePhoto", "business_connection_id" | "photo">, signal?: AbortSignal): Promise<true>;
|
|
1354
|
+
/**
|
|
1355
|
+
* Context-aware alias for `api.removeBusinessAccountProfilePhoto`. Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.
|
|
1356
|
+
*
|
|
1357
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1358
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1359
|
+
*
|
|
1360
|
+
* **Official reference:** https://core.telegram.org/bots/api#removebusinessaccountprofilephoto
|
|
1361
|
+
*/
|
|
1362
|
+
removeBusinessAccountProfilePhoto(other: Other<"removeBusinessAccountProfilePhoto", "business_connection_id">, signal?: AbortSignal): Promise<true>;
|
|
1363
|
+
/**
|
|
1364
|
+
* Context-aware alias for `api.setBusinessAccountGiftSettings`. Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success.
|
|
1365
|
+
*
|
|
1366
|
+
* @param show_gift_button Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field
|
|
1367
|
+
* @param accepted_gift_types Types of gifts accepted by the business account
|
|
1368
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1369
|
+
*
|
|
1370
|
+
* **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountgiftsettings
|
|
1371
|
+
*/
|
|
1372
|
+
setBusinessAccountGiftSettings(show_gift_button: boolean, accepted_gift_types: AcceptedGiftTypes, signal?: AbortSignal): Promise<true>;
|
|
1373
|
+
/**
|
|
1374
|
+
* Context-aware alias for `api.getBusinessAccountStarBalance`. Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success.
|
|
1375
|
+
*
|
|
1376
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1377
|
+
*
|
|
1378
|
+
* **Official reference:** https://core.telegram.org/bots/api#getbusinessaccountstarbalance
|
|
1379
|
+
*/
|
|
1380
|
+
getBusinessAccountStarBalance(signal?: AbortSignal): Promise<import("@grammyjs/types/payment.js").StarAmount>;
|
|
1381
|
+
/**
|
|
1382
|
+
* Context-aware alias for `api.transferBusinessAccountStars`. Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.
|
|
1383
|
+
*
|
|
1384
|
+
* @param star_count Number of Telegram Stars to transfer; 1-10000
|
|
1385
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1386
|
+
*
|
|
1387
|
+
* **Official reference:** https://core.telegram.org/bots/api#transferbusinessaccountstars
|
|
1388
|
+
*/
|
|
1389
|
+
transferBusinessAccountStars(star_count: number, signal?: AbortSignal): Promise<true>;
|
|
1390
|
+
/**
|
|
1391
|
+
* Context-aware alias for `api.getBusinessAccountGifts`. Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success.
|
|
1392
|
+
*
|
|
1393
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1394
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1395
|
+
*
|
|
1396
|
+
* **Official reference:** https://core.telegram.org/bots/api#getbusinessaccountgifts
|
|
1397
|
+
*/
|
|
1398
|
+
getBusinessAccountGifts(other: Other<"getBusinessAccountGifts", "business_connection_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/payment.js").OwnedGifts>;
|
|
1399
|
+
/**
|
|
1400
|
+
* Context-aware alias for `api.convertGiftToStars`. Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.
|
|
1401
|
+
*
|
|
1402
|
+
* @param owned_gift_id Unique identifier of the regular gift that should be converted to Telegram Stars
|
|
1403
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1404
|
+
*
|
|
1405
|
+
* **Official reference:** https://core.telegram.org/bots/api#convertgifttostars
|
|
1406
|
+
*/
|
|
1407
|
+
convertGiftToStars(owned_gift_id: string, signal?: AbortSignal): Promise<true>;
|
|
1408
|
+
/**
|
|
1409
|
+
* Context-aware alias for `api.upgradeGift`. Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success.
|
|
1410
|
+
*
|
|
1411
|
+
* @param owned_gift_id Unique identifier of the regular gift that should be upgraded to a unique one
|
|
1412
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1413
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1414
|
+
*
|
|
1415
|
+
* **Official reference:** https://core.telegram.org/bots/api#upgradegift
|
|
1416
|
+
*/
|
|
1417
|
+
upgradeGift(owned_gift_id: string, other: Other<"getBusinessAccountGifts", "business_connection_id" | "owned_gift_id">, signal?: AbortSignal): Promise<true>;
|
|
1418
|
+
/**
|
|
1419
|
+
* Context-aware alias for `api.transferGift`. Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success.
|
|
1420
|
+
*
|
|
1421
|
+
* @param owned_gift_id Unique identifier of the regular gift that should be transferred
|
|
1422
|
+
* @param new_owner_chat_id Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.
|
|
1423
|
+
* @param star_count The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required.
|
|
1424
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1425
|
+
*
|
|
1426
|
+
* **Official reference:** https://core.telegram.org/bots/api#transfergift
|
|
1427
|
+
*/
|
|
1428
|
+
transferGift(owned_gift_id: string, new_owner_chat_id: number, star_count: number, signal?: AbortSignal): Promise<true>;
|
|
1429
|
+
/**
|
|
1430
|
+
* Context-aware alias for `api.postStory`. Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.
|
|
1431
|
+
*
|
|
1432
|
+
* @param content Content of the story
|
|
1433
|
+
* @param active_period Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400
|
|
1434
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1435
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1436
|
+
*
|
|
1437
|
+
* **Official reference:** https://core.telegram.org/bots/api#poststory
|
|
1438
|
+
*/
|
|
1439
|
+
postStory(content: InputStoryContent, active_period: number, other: Other<"postStory", "business_connection_id" | "content" | "active_period">, signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").Story>;
|
|
1440
|
+
/**
|
|
1441
|
+
* Context-aware alias for `api.`. editStoryEdits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.
|
|
1442
|
+
*
|
|
1443
|
+
* @param story_id Unique identifier of the story to edit
|
|
1444
|
+
* @param content Content of the story
|
|
1445
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1446
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1447
|
+
*
|
|
1448
|
+
* **Official reference:** https://core.telegram.org/bots/api#editstory
|
|
1449
|
+
*/
|
|
1450
|
+
editStory(story_id: number, content: InputStoryContent, other: Other<"editStory", "business_connection_id" | "story_id" | "content">, signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").Story>;
|
|
1451
|
+
/**
|
|
1452
|
+
* Context-aware alias for `api.deleteStory`. Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success.
|
|
1453
|
+
*
|
|
1454
|
+
* @param story_id Unique identifier of the story to delete
|
|
1455
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1456
|
+
*
|
|
1457
|
+
* **Official reference:** https://core.telegram.org/bots/api#deletestory
|
|
1458
|
+
*/
|
|
1459
|
+
deleteStory(story_id: number, signal?: AbortSignal): Promise<true>;
|
|
1307
1460
|
/**
|
|
1308
1461
|
* Context-aware alias for `api.sendSticker`. Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.
|
|
1309
1462
|
*
|
|
@@ -1333,6 +1486,17 @@ export declare class Context implements RenamedUpdate {
|
|
|
1333
1486
|
* **Official reference:** https://core.telegram.org/bots/api#sendgift
|
|
1334
1487
|
*/
|
|
1335
1488
|
replyWithGift(gift_id: string, other?: Other<"sendGift", "user_id" | "chat_id" | "gift_id">, signal?: AbortSignal): Promise<import("@grammyjs/types/payment.js").Gifts>;
|
|
1489
|
+
/**
|
|
1490
|
+
* Context-aware alias for `api.giftPremiumSubscription`. Gifts a Telegram Premium subscription to the given user. Returns True on success.
|
|
1491
|
+
*
|
|
1492
|
+
* @param month_count Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12
|
|
1493
|
+
* @param star_count Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months
|
|
1494
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1495
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1496
|
+
*
|
|
1497
|
+
* **Official reference:** https://core.telegram.org/bots/api#giftpremiumsubscription
|
|
1498
|
+
*/
|
|
1499
|
+
giftPremiumSubscription(month_count: 3 | 6 | 12, star_count: 1000 | 1500 | 2500, other?: Other<"giftPremiumSubscription", "user_id" | "month_count" | "star_count">, signal?: AbortSignal): Promise<true>;
|
|
1336
1500
|
/**
|
|
1337
1501
|
* Context-aware alias for `api.sendGift`. Sends a gift to the given channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.
|
|
1338
1502
|
*
|
|
@@ -1453,6 +1617,14 @@ export declare class Context implements RenamedUpdate {
|
|
|
1453
1617
|
* **Official reference:** https://core.telegram.org/bots/api#removechatverification
|
|
1454
1618
|
*/
|
|
1455
1619
|
removeChatVerification(signal?: AbortSignal): Promise<true>;
|
|
1620
|
+
/**
|
|
1621
|
+
* Context-aware alias for `api.readBusinessMessage`. Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.
|
|
1622
|
+
*
|
|
1623
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1624
|
+
*
|
|
1625
|
+
* **Official reference:** https://core.telegram.org/bots/api#readbusinessmessage
|
|
1626
|
+
*/
|
|
1627
|
+
readBusinessMessage(signal?: AbortSignal): Promise<true>;
|
|
1456
1628
|
/**
|
|
1457
1629
|
* Context-aware alias for `api.setPassportDataErrors`. Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
|
|
1458
1630
|
*
|
package/out/context.js
CHANGED
|
@@ -972,7 +972,7 @@ class Context {
|
|
|
972
972
|
return this.api.getUserProfilePhotos(orThrow(this.from, "getUserProfilePhotos").id, other, signal);
|
|
973
973
|
}
|
|
974
974
|
/**
|
|
975
|
-
*
|
|
975
|
+
* Context-aware alias for `api.serUserEmojiStatus`. Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success.
|
|
976
976
|
*
|
|
977
977
|
* @param other Optional remaining parameters, confer the official reference below
|
|
978
978
|
* @param signal Optional `AbortSignal` to cancel the request
|
|
@@ -1716,6 +1716,191 @@ class Context {
|
|
|
1716
1716
|
deleteMessages(message_ids, signal) {
|
|
1717
1717
|
return this.api.deleteMessages(orThrow(this.chatId, "deleteMessages"), message_ids, signal);
|
|
1718
1718
|
}
|
|
1719
|
+
/**
|
|
1720
|
+
* Context-aware alias for `api.deleteBusinessMessages`. Delete messages on behalf of a business account. Requires the can_delete_outgoing_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success.
|
|
1721
|
+
*
|
|
1722
|
+
* @param message_ids A list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted
|
|
1723
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1724
|
+
*
|
|
1725
|
+
* **Official reference:** https://core.telegram.org/bots/api#deletebusinessmessages
|
|
1726
|
+
*/
|
|
1727
|
+
deleteBusinessMessages(message_ids, signal) {
|
|
1728
|
+
return this.api.deleteBusinessMessages(orThrow(this.businessConnectionId, "deleteBusinessMessages"), message_ids, signal);
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* Context-aware alias for `api.setBusinessAccountName`. Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.
|
|
1732
|
+
*
|
|
1733
|
+
* @param first_name The new value of the first name for the business account; 1-64 characters
|
|
1734
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1735
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1736
|
+
*
|
|
1737
|
+
* **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountname
|
|
1738
|
+
*/
|
|
1739
|
+
setBusinessAccountName(first_name, other, signal) {
|
|
1740
|
+
return this.api.setBusinessAccountName(orThrow(this.businessConnectionId, "setBusinessAccountName"), first_name, other, signal);
|
|
1741
|
+
}
|
|
1742
|
+
/**
|
|
1743
|
+
* Context-aware alias for `api.setBusinessAccountUsername`. Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.
|
|
1744
|
+
*
|
|
1745
|
+
* @param username The new value of the username for the business account; 0-32 characters
|
|
1746
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1747
|
+
*
|
|
1748
|
+
* **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountusername
|
|
1749
|
+
*/
|
|
1750
|
+
setBusinessAccountUsername(username, signal) {
|
|
1751
|
+
return this.api.setBusinessAccountUsername(orThrow(this.businessConnectionId, "setBusinessAccountUsername"), username, signal);
|
|
1752
|
+
}
|
|
1753
|
+
/**
|
|
1754
|
+
* Context-aware alias for `api.setBusinessAccountBio`. Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success.
|
|
1755
|
+
*
|
|
1756
|
+
* @param bio The new value of the bio for the business account; 0-140 characters
|
|
1757
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1758
|
+
*
|
|
1759
|
+
* **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountbio
|
|
1760
|
+
*/
|
|
1761
|
+
setBusinessAccountBio(bio, signal) {
|
|
1762
|
+
return this.api.setBusinessAccountBio(orThrow(this.businessConnectionId, "setBusinessAccountBio"), bio, signal);
|
|
1763
|
+
}
|
|
1764
|
+
/**
|
|
1765
|
+
* Context-aware alias for `api.setBusinessAccountProfilePhoto`. CsetBusinessAccountProfilePhotohanges the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.
|
|
1766
|
+
*
|
|
1767
|
+
* @param photo The new profile photo to set
|
|
1768
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1769
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1770
|
+
*
|
|
1771
|
+
* **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountprofilephoto
|
|
1772
|
+
*/
|
|
1773
|
+
setBusinessAccountProfilePhoto(photo, other, signal) {
|
|
1774
|
+
return this.api.setBusinessAccountProfilePhoto(orThrow(this.businessConnectionId, "setBusinessAccountProfilePhoto"), photo, other, signal);
|
|
1775
|
+
}
|
|
1776
|
+
/**
|
|
1777
|
+
* Context-aware alias for `api.removeBusinessAccountProfilePhoto`. Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.
|
|
1778
|
+
*
|
|
1779
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1780
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1781
|
+
*
|
|
1782
|
+
* **Official reference:** https://core.telegram.org/bots/api#removebusinessaccountprofilephoto
|
|
1783
|
+
*/
|
|
1784
|
+
removeBusinessAccountProfilePhoto(other, signal) {
|
|
1785
|
+
return this.api.removeBusinessAccountProfilePhoto(orThrow(this.businessConnectionId, "removeBusinessAccountProfilePhoto"), other, signal);
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* Context-aware alias for `api.setBusinessAccountGiftSettings`. Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success.
|
|
1789
|
+
*
|
|
1790
|
+
* @param show_gift_button Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field
|
|
1791
|
+
* @param accepted_gift_types Types of gifts accepted by the business account
|
|
1792
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1793
|
+
*
|
|
1794
|
+
* **Official reference:** https://core.telegram.org/bots/api#setbusinessaccountgiftsettings
|
|
1795
|
+
*/
|
|
1796
|
+
setBusinessAccountGiftSettings(show_gift_button, accepted_gift_types, signal) {
|
|
1797
|
+
return this.api.setBusinessAccountGiftSettings(orThrow(this.businessConnectionId, "setBusinessAccountGiftSettings"), show_gift_button, accepted_gift_types, signal);
|
|
1798
|
+
}
|
|
1799
|
+
/**
|
|
1800
|
+
* Context-aware alias for `api.getBusinessAccountStarBalance`. Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success.
|
|
1801
|
+
*
|
|
1802
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1803
|
+
*
|
|
1804
|
+
* **Official reference:** https://core.telegram.org/bots/api#getbusinessaccountstarbalance
|
|
1805
|
+
*/
|
|
1806
|
+
getBusinessAccountStarBalance(signal) {
|
|
1807
|
+
return this.api.getBusinessAccountStarBalance(orThrow(this.businessConnectionId, "getBusinessAccountStarBalance"), signal);
|
|
1808
|
+
}
|
|
1809
|
+
/**
|
|
1810
|
+
* Context-aware alias for `api.transferBusinessAccountStars`. Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.
|
|
1811
|
+
*
|
|
1812
|
+
* @param star_count Number of Telegram Stars to transfer; 1-10000
|
|
1813
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1814
|
+
*
|
|
1815
|
+
* **Official reference:** https://core.telegram.org/bots/api#transferbusinessaccountstars
|
|
1816
|
+
*/
|
|
1817
|
+
transferBusinessAccountStars(star_count, signal) {
|
|
1818
|
+
return this.api.transferBusinessAccountStars(orThrow(this.businessConnectionId, "transferBusinessAccountStars"), star_count, signal);
|
|
1819
|
+
}
|
|
1820
|
+
/**
|
|
1821
|
+
* Context-aware alias for `api.getBusinessAccountGifts`. Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success.
|
|
1822
|
+
*
|
|
1823
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1824
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1825
|
+
*
|
|
1826
|
+
* **Official reference:** https://core.telegram.org/bots/api#getbusinessaccountgifts
|
|
1827
|
+
*/
|
|
1828
|
+
getBusinessAccountGifts(other, signal) {
|
|
1829
|
+
return this.api.getBusinessAccountGifts(orThrow(this.businessConnectionId, "getBusinessAccountGifts"), other, signal);
|
|
1830
|
+
}
|
|
1831
|
+
/**
|
|
1832
|
+
* Context-aware alias for `api.convertGiftToStars`. Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.
|
|
1833
|
+
*
|
|
1834
|
+
* @param owned_gift_id Unique identifier of the regular gift that should be converted to Telegram Stars
|
|
1835
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1836
|
+
*
|
|
1837
|
+
* **Official reference:** https://core.telegram.org/bots/api#convertgifttostars
|
|
1838
|
+
*/
|
|
1839
|
+
convertGiftToStars(owned_gift_id, signal) {
|
|
1840
|
+
return this.api.convertGiftToStars(orThrow(this.businessConnectionId, "convertGiftToStars"), owned_gift_id, signal);
|
|
1841
|
+
}
|
|
1842
|
+
/**
|
|
1843
|
+
* Context-aware alias for `api.upgradeGift`. Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success.
|
|
1844
|
+
*
|
|
1845
|
+
* @param owned_gift_id Unique identifier of the regular gift that should be upgraded to a unique one
|
|
1846
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1847
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1848
|
+
*
|
|
1849
|
+
* **Official reference:** https://core.telegram.org/bots/api#upgradegift
|
|
1850
|
+
*/
|
|
1851
|
+
upgradeGift(owned_gift_id, other, signal) {
|
|
1852
|
+
return this.api.upgradeGift(orThrow(this.businessConnectionId, "upgradeGift"), owned_gift_id, other, signal);
|
|
1853
|
+
}
|
|
1854
|
+
/**
|
|
1855
|
+
* Context-aware alias for `api.transferGift`. Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success.
|
|
1856
|
+
*
|
|
1857
|
+
* @param owned_gift_id Unique identifier of the regular gift that should be transferred
|
|
1858
|
+
* @param new_owner_chat_id Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.
|
|
1859
|
+
* @param star_count The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required.
|
|
1860
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1861
|
+
*
|
|
1862
|
+
* **Official reference:** https://core.telegram.org/bots/api#transfergift
|
|
1863
|
+
*/
|
|
1864
|
+
transferGift(owned_gift_id, new_owner_chat_id, star_count, signal) {
|
|
1865
|
+
return this.api.transferGift(orThrow(this.businessConnectionId, "transferGift"), owned_gift_id, new_owner_chat_id, star_count, signal);
|
|
1866
|
+
}
|
|
1867
|
+
/**
|
|
1868
|
+
* Context-aware alias for `api.postStory`. Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.
|
|
1869
|
+
*
|
|
1870
|
+
* @param content Content of the story
|
|
1871
|
+
* @param active_period Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400
|
|
1872
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1873
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1874
|
+
*
|
|
1875
|
+
* **Official reference:** https://core.telegram.org/bots/api#poststory
|
|
1876
|
+
*/
|
|
1877
|
+
postStory(content, active_period, other, signal) {
|
|
1878
|
+
return this.api.postStory(orThrow(this.businessConnectionId, "postStory"), content, active_period, other, signal);
|
|
1879
|
+
}
|
|
1880
|
+
/**
|
|
1881
|
+
* Context-aware alias for `api.`. editStoryEdits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.
|
|
1882
|
+
*
|
|
1883
|
+
* @param story_id Unique identifier of the story to edit
|
|
1884
|
+
* @param content Content of the story
|
|
1885
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1886
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1887
|
+
*
|
|
1888
|
+
* **Official reference:** https://core.telegram.org/bots/api#editstory
|
|
1889
|
+
*/
|
|
1890
|
+
editStory(story_id, content, other, signal) {
|
|
1891
|
+
return this.api.editStory(orThrow(this.businessConnectionId, "editStory"), story_id, content, other, signal);
|
|
1892
|
+
}
|
|
1893
|
+
/**
|
|
1894
|
+
* Context-aware alias for `api.deleteStory`. Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success.
|
|
1895
|
+
*
|
|
1896
|
+
* @param story_id Unique identifier of the story to delete
|
|
1897
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1898
|
+
*
|
|
1899
|
+
* **Official reference:** https://core.telegram.org/bots/api#deletestory
|
|
1900
|
+
*/
|
|
1901
|
+
deleteStory(story_id, signal) {
|
|
1902
|
+
return this.api.deleteStory(orThrow(this.businessConnectionId, "deleteStory"), story_id, signal);
|
|
1903
|
+
}
|
|
1719
1904
|
/**
|
|
1720
1905
|
* Context-aware alias for `api.sendSticker`. Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.
|
|
1721
1906
|
*
|
|
@@ -1754,6 +1939,19 @@ class Context {
|
|
|
1754
1939
|
replyWithGift(gift_id, other, signal) {
|
|
1755
1940
|
return this.api.sendGift(orThrow(this.from, "sendGift").id, gift_id, other, signal);
|
|
1756
1941
|
}
|
|
1942
|
+
/**
|
|
1943
|
+
* Context-aware alias for `api.giftPremiumSubscription`. Gifts a Telegram Premium subscription to the given user. Returns True on success.
|
|
1944
|
+
*
|
|
1945
|
+
* @param month_count Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12
|
|
1946
|
+
* @param star_count Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months
|
|
1947
|
+
* @param other Optional remaining parameters, confer the official reference below
|
|
1948
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
1949
|
+
*
|
|
1950
|
+
* **Official reference:** https://core.telegram.org/bots/api#giftpremiumsubscription
|
|
1951
|
+
*/
|
|
1952
|
+
giftPremiumSubscription(month_count, star_count, other, signal) {
|
|
1953
|
+
return this.api.giftPremiumSubscription(orThrow(this.from, "giftPremiumSubscription").id, month_count, star_count, other, signal);
|
|
1954
|
+
}
|
|
1757
1955
|
/**
|
|
1758
1956
|
* Context-aware alias for `api.sendGift`. Sends a gift to the given channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.
|
|
1759
1957
|
*
|
|
@@ -1900,6 +2098,16 @@ class Context {
|
|
|
1900
2098
|
removeChatVerification(signal) {
|
|
1901
2099
|
return this.api.removeChatVerification(orThrow(this.chatId, "removeChatVerification"), signal);
|
|
1902
2100
|
}
|
|
2101
|
+
/**
|
|
2102
|
+
* Context-aware alias for `api.readBusinessMessage`. Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.
|
|
2103
|
+
*
|
|
2104
|
+
* @param signal Optional `AbortSignal` to cancel the request
|
|
2105
|
+
*
|
|
2106
|
+
* **Official reference:** https://core.telegram.org/bots/api#readbusinessmessage
|
|
2107
|
+
*/
|
|
2108
|
+
readBusinessMessage(signal) {
|
|
2109
|
+
return this.api.readBusinessMessage(orThrow(this.businessConnectionId, "readBusinessMessage"), orThrow(this.chatId, "readBusinessMessage"), orThrow(this.msgId, "readBusinessMessage"), signal);
|
|
2110
|
+
}
|
|
1903
2111
|
/**
|
|
1904
2112
|
* Context-aware alias for `api.setPassportDataErrors`. Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
|
|
1905
2113
|
*
|
|
@@ -332,7 +332,7 @@ export declare class Keyboard {
|
|
|
332
332
|
* [d e f]
|
|
333
333
|
*
|
|
334
334
|
* [a b c] [ a ]
|
|
335
|
-
* [d e f] ~> [b c d] (3
|
|
335
|
+
* [d e f] ~> [b c d] (3 columns, { fillLastRow: true })
|
|
336
336
|
* [g h i] [e f g]
|
|
337
337
|
* [ j ] [h i j]
|
|
338
338
|
* ```
|
|
@@ -728,7 +728,7 @@ export declare class InlineKeyboard {
|
|
|
728
728
|
* [d e f]
|
|
729
729
|
*
|
|
730
730
|
* [a b c] [ a ]
|
|
731
|
-
* [d e f] ~> [b c d] (3
|
|
731
|
+
* [d e f] ~> [b c d] (3 columns, { fillLastRow: true })
|
|
732
732
|
* [g h i] [e f g]
|
|
733
733
|
* [ j ] [h i j]
|
|
734
734
|
* ```
|
|
@@ -367,7 +367,7 @@ class Keyboard {
|
|
|
367
367
|
* [d e f]
|
|
368
368
|
*
|
|
369
369
|
* [a b c] [ a ]
|
|
370
|
-
* [d e f] ~> [b c d] (3
|
|
370
|
+
* [d e f] ~> [b c d] (3 columns, { fillLastRow: true })
|
|
371
371
|
* [g h i] [e f g]
|
|
372
372
|
* [ j ] [h i j]
|
|
373
373
|
* ```
|
|
@@ -852,7 +852,7 @@ class InlineKeyboard {
|
|
|
852
852
|
* [d e f]
|
|
853
853
|
*
|
|
854
854
|
* [a b c] [ a ]
|
|
855
|
-
* [d e f] ~> [b c d] (3
|
|
855
|
+
* [d e f] ~> [b c d] (3 columns, { fillLastRow: true })
|
|
856
856
|
* [g h i] [e f g]
|
|
857
857
|
* [ j ] [h i j]
|
|
858
858
|
* ```
|