grammy 1.35.0 β 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 +6 -2
- package/out/bot.js +1 -1
- package/out/context.d.ts +177 -5
- package/out/context.js +226 -18
- package/out/convenience/frameworks.d.ts +16 -11
- package/out/convenience/frameworks.js +16 -2
- package/out/convenience/keyboard.d.ts +2 -2
- package/out/convenience/keyboard.js +2 -2
- package/out/convenience/webhook.d.ts +1 -0
- package/out/core/api.d.ts +198 -6
- package/out/core/api.js +239 -6
- package/out/filter.d.ts +25 -1
- package/out/filter.js +4 -0
- package/out/mod.d.ts +1 -1
- package/out/types.node.d.ts +17 -1
- package/out/web.mjs +262 -14
- 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>
|
|
@@ -323,6 +323,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
323
323
|
<td align="center" valign="top" width="11.11%"><a href="https://github.com/Hth4nh"><img src="https://avatars.githubusercontent.com/u/63627651?v=4?s=100" width="100px;" alt="ThΓ nh HoΓ ng TrαΊ§n"/><br /><sub><b>ThΓ nh HoΓ ng TrαΊ§n</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=Hth4nh" title="Documentation">π</a></td>
|
|
324
324
|
<td align="center" valign="top" width="11.11%"><a href="https://github.com/ikelax"><img src="https://avatars.githubusercontent.com/u/163678144?v=4?s=100" width="100px;" alt="ikelax"/><br /><sub><b>ikelax</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=ikelax" title="Documentation">π</a></td>
|
|
325
325
|
<td align="center" valign="top" width="11.11%"><a href="http://zeokku.com"><img src="https://avatars.githubusercontent.com/u/22231294?v=4?s=100" width="100px;" alt="Lutymane"/><br /><sub><b>Lutymane</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=Lutymane" title="Code">π»</a></td>
|
|
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
|
+
<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
|
+
<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>
|
|
326
330
|
</tr>
|
|
327
331
|
</tbody>
|
|
328
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
|
|
@@ -1007,7 +1007,7 @@ export declare class Context implements RenamedUpdate {
|
|
|
1007
1007
|
*
|
|
1008
1008
|
* **Official reference:** https://core.telegram.org/bots/api#unpinchatmessage
|
|
1009
1009
|
*/
|
|
1010
|
-
unpinChatMessage(message_id?: number, signal?: AbortSignal): Promise<true>;
|
|
1010
|
+
unpinChatMessage(message_id?: number, other?: Other<"unpinChatMessage", "chat_id" | "message_id">, signal?: AbortSignal): Promise<true>;
|
|
1011
1011
|
/**
|
|
1012
1012
|
* Context-aware alias for `api.unpinAllChatMessages`. Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
|
|
1013
1013
|
*
|
|
@@ -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
|
*
|
|
@@ -1589,7 +1761,7 @@ type ShippingQueryContextCore = FilterCore<"shipping_query">;
|
|
|
1589
1761
|
* in separate files and still have the correct types.
|
|
1590
1762
|
*/
|
|
1591
1763
|
export type ShippingQueryContext<C extends Context> = Filter<NarrowMatch<C, string | RegExpMatchArray>, "shipping_query">;
|
|
1592
|
-
type ChatTypeContextCore<T extends Chat["type"]> = Record<"update", ChatTypeUpdate<T>> & ChatType<T> & Record<"chatId", number> & ChatFrom<T> & ChatTypeRecord<"msg", T> & AliasProps<ChatTypeUpdate<T
|
|
1764
|
+
type ChatTypeContextCore<T extends Chat["type"]> = T extends unknown ? Record<"update", ChatTypeUpdate<T>> & ChatType<T> & Record<"chatId", number> & ChatFrom<T> & ChatTypeRecord<"msg", T> & AliasProps<ChatTypeUpdate<T>> : never;
|
|
1593
1765
|
/**
|
|
1594
1766
|
* Type of the context object that is available inside the handlers for
|
|
1595
1767
|
* `bot.chatType`.
|