grammy 1.24.1 → 1.25.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 CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  <!-- deno-fmt-ignore-start -->
12
12
 
13
- [![Bot API](https://img.shields.io/badge/Bot%20API-7.4-blue?logo=telegram&style=flat&labelColor=000&color=3b82f6)](https://core.telegram.org/bots/api)
13
+ [![Bot API](https://img.shields.io/badge/Bot%20API-7.5-blue?logo=telegram&style=flat&labelColor=000&color=3b82f6)](https://core.telegram.org/bots/api)
14
14
  [![Deno](https://shield.deno.dev/x/grammy)](https://deno.land/x/grammy)
15
15
  [![npm](https://img.shields.io/npm/v/grammy?logo=npm&style=flat&labelColor=000&color=3b82f6)](https://www.npmjs.org/package/grammy)
16
16
  [![All Contributors](https://img.shields.io/github/all-contributors/grammyjs/grammy?style=flat&labelColor=000&color=3b82f6)](#contributors-)
@@ -299,6 +299,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
299
299
  <td align="center" valign="top" width="11.11%"><a href="https://github.com/carafelix"><img src="https://avatars.githubusercontent.com/u/48109042?v=4?s=100" width="100px;" alt="Hero Protagonist"/><br /><sub><b>Hero Protagonist</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=carafelix" title="Code">💻</a> <a href="https://github.com/grammyjs/grammY/issues?q=author%3Acarafelix" title="Bug reports">🐛</a> <a href="#ideas-carafelix" title="Ideas, Planning, & Feedback">🤔</a> <a href="#plugin-carafelix" title="Plugin/utility libraries">🔌</a></td>
300
300
  <td align="center" valign="top" width="11.11%"><a href="https://github.com/MobinAskari"><img src="https://avatars.githubusercontent.com/u/132358316?v=4?s=100" width="100px;" alt="Mobin Askari"/><br /><sub><b>Mobin Askari</b></sub></a><br /><a href="#plugin-MobinAskari" title="Plugin/utility libraries">🔌</a></td>
301
301
  <td align="center" valign="top" width="11.11%"><a href="https://github.com/ubertao"><img src="https://avatars.githubusercontent.com/u/4099333?v=4?s=100" width="100px;" alt="Ubertao"/><br /><sub><b>Ubertao</b></sub></a><br /><a href="#ideas-ubertao" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/grammyjs/grammY/commits?author=ubertao" title="Code">💻</a></td>
302
+ <td align="center" valign="top" width="11.11%"><a href="https://github.com/SunsetTechuila"><img src="https://avatars.githubusercontent.com/u/115353812?v=4?s=100" width="100px;" alt="Grigory"/><br /><sub><b>Grigory</b></sub></a><br /><a href="#ideas-SunsetTechuila" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/grammyjs/grammY/commits?author=SunsetTechuila" title="Code">💻</a> <a href="https://github.com/grammyjs/grammY/commits?author=SunsetTechuila" title="Documentation">📖</a></td>
302
303
  </tr>
303
304
  </tbody>
304
305
  </table>
package/out/context.d.ts CHANGED
@@ -796,11 +796,12 @@ export declare class Context implements RenamedUpdate {
796
796
  * Context-aware alias for `api.setChatPermissions`. Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.
797
797
  *
798
798
  * @param permissions New default chat permissions
799
+ * @param other Optional remaining parameters, confer the official reference below
799
800
  * @param signal Optional `AbortSignal` to cancel the request
800
801
  *
801
802
  * **Official reference:** https://core.telegram.org/bots/api#setchatpermissions
802
803
  */
803
- setChatPermissions(permissions: ChatPermissions, signal?: AbortSignal): Promise<true>;
804
+ setChatPermissions(permissions: ChatPermissions, other?: Other<"setChatPermissions", "chat_id" | "permissions">, signal?: AbortSignal): Promise<true>;
804
805
  /**
805
806
  * Context-aware alias for `api.exportChatInviteLink`. Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.
806
807
  *
@@ -1133,7 +1134,7 @@ export declare class Context implements RenamedUpdate {
1133
1134
  */
1134
1135
  getMyDefaultAdministratorRights(other?: Other<"getMyDefaultAdministratorRights">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatAdministratorRights>;
1135
1136
  /**
1136
- * Context-aware alias for `api.editMessageText`. Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1137
+ * Context-aware alias for `api.editMessageText`. Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1137
1138
  *
1138
1139
  * @param text New text of the message, 1-4096 characters after entities parsing
1139
1140
  * @param other Optional remaining parameters, confer the official reference below
@@ -1145,7 +1146,7 @@ export declare class Context implements RenamedUpdate {
1145
1146
  text: string;
1146
1147
  })>;
1147
1148
  /**
1148
- * Context-aware alias for `api.editMessageCaption`. Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1149
+ * Context-aware alias for `api.editMessageCaption`. Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1149
1150
  *
1150
1151
  * @param other Optional remaining parameters, confer the official reference below
1151
1152
  * @param signal Optional `AbortSignal` to cancel the request
@@ -1154,7 +1155,7 @@ export declare class Context implements RenamedUpdate {
1154
1155
  */
1155
1156
  editMessageCaption(other?: Other<"editMessageCaption", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (Update.Edited & Message.CaptionableMessage)>;
1156
1157
  /**
1157
- * Context-aware alias for `api.editMessageMedia`. Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1158
+ * Context-aware alias for `api.editMessageMedia`. Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1158
1159
  *
1159
1160
  * @param media An object for a new media content of the message
1160
1161
  * @param other Optional remaining parameters, confer the official reference below
@@ -1164,7 +1165,7 @@ export declare class Context implements RenamedUpdate {
1164
1165
  */
1165
1166
  editMessageMedia(media: InputMedia, other?: Other<"editMessageMedia", "chat_id" | "message_id" | "inline_message_id" | "media">, signal?: AbortSignal): Promise<true | (Update.Edited & Message)>;
1166
1167
  /**
1167
- * Context-aware alias for `api.editMessageReplyMarkup`. Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1168
+ * Context-aware alias for `api.editMessageReplyMarkup`. Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1168
1169
  *
1169
1170
  * @param other Optional remaining parameters, confer the official reference below
1170
1171
  * @param signal Optional `AbortSignal` to cancel the request
@@ -1357,7 +1358,7 @@ type GameQueryContextCore = FilterCore<"callback_query:game_short_name">;
1357
1358
  * inferring the correct type automatically. That way, handlers can be defined
1358
1359
  * in separate files and still have the correct types.
1359
1360
  */
1360
- export type GameQueryContext<C extends Context> = Filter<C, "callback_query:game_short_name">;
1361
+ export type GameQueryContext<C extends Context> = Filter<NarrowMatch<C, string | RegExpMatchArray>, "callback_query:game_short_name">;
1361
1362
  type InlineQueryContextCore = FilterCore<"inline_query">;
1362
1363
  /**
1363
1364
  * Type of the context object that is available inside the handlers for
@@ -1369,7 +1370,7 @@ type InlineQueryContextCore = FilterCore<"inline_query">;
1369
1370
  * inferring the correct type automatically. That way, handlers can be defined
1370
1371
  * in separate files and still have the correct types.
1371
1372
  */
1372
- export type InlineQueryContext<C extends Context> = Filter<C, "inline_query">;
1373
+ export type InlineQueryContext<C extends Context> = Filter<NarrowMatch<C, string | RegExpMatchArray>, "inline_query">;
1373
1374
  type ReactionContextCore = FilterCore<"message_reaction">;
1374
1375
  /**
1375
1376
  * Type of the context object that is available inside the handlers for
@@ -1393,8 +1394,8 @@ type ChosenInlineResultContextCore = FilterCore<"chosen_inline_result">;
1393
1394
  * inferring the correct type automatically. That way, handlers can be defined
1394
1395
  * in separate files and still have the correct types.
1395
1396
  */
1396
- export type ChosenInlineResultContext<C extends Context> = Filter<C, "chosen_inline_result">;
1397
- type ChatTypeContextCore<T extends Chat["type"]> = Record<"update", ChatTypeUpdate<T>> & ChatType<T> & ChatFrom<T> & ChatTypeRecord<"msg", T> & AliasProps<ChatTypeUpdate<T>>;
1397
+ export type ChosenInlineResultContext<C extends Context> = Filter<NarrowMatch<C, string | RegExpMatchArray>, "chosen_inline_result">;
1398
+ type ChatTypeContextCore<T extends Chat["type"]> = Record<"update", ChatTypeUpdate<T>> & ChatType<T> & Record<"chatId", number> & ChatFrom<T> & ChatTypeRecord<"msg", T> & AliasProps<ChatTypeUpdate<T>>;
1398
1399
  /**
1399
1400
  * Type of the context object that is available inside the handlers for
1400
1401
  * `bot.chatType`.
@@ -1405,7 +1406,7 @@ type ChatTypeContextCore<T extends Chat["type"]> = Record<"update", ChatTypeUpda
1405
1406
  * the correct type automatically. That way, handlers can be defined in separate
1406
1407
  * files and still have the correct types.
1407
1408
  */
1408
- export type ChatTypeContext<C extends Context, T extends Chat["type"]> = C & ChatTypeContextCore<T>;
1409
+ export type ChatTypeContext<C extends Context, T extends Chat["type"]> = T extends unknown ? C & ChatTypeContextCore<T> : never;
1409
1410
  type ChatTypeUpdate<T extends Chat["type"]> = ChatTypeRecord<"message" | "edited_message" | "channel_post" | "edited_channel_post" | "my_chat_member" | "chat_member" | "chat_join_request", T> & Partial<Record<"callback_query", ChatTypeRecord<"message", T>>> & ConstrainUpdatesByChatType<T>;
1410
1411
  type ConstrainUpdatesByChatType<T extends Chat["type"]> = Record<[
1411
1412
  T
package/out/context.js CHANGED
@@ -1070,12 +1070,13 @@ class Context {
1070
1070
  * Context-aware alias for `api.setChatPermissions`. Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.
1071
1071
  *
1072
1072
  * @param permissions New default chat permissions
1073
+ * @param other Optional remaining parameters, confer the official reference below
1073
1074
  * @param signal Optional `AbortSignal` to cancel the request
1074
1075
  *
1075
1076
  * **Official reference:** https://core.telegram.org/bots/api#setchatpermissions
1076
1077
  */
1077
- setChatPermissions(permissions, signal) {
1078
- return this.api.setChatPermissions(orThrow(this.chatId, "setChatPermissions"), permissions, signal);
1078
+ setChatPermissions(permissions, other, signal) {
1079
+ return this.api.setChatPermissions(orThrow(this.chatId, "setChatPermissions"), permissions, other, signal);
1079
1080
  }
1080
1081
  /**
1081
1082
  * Context-aware alias for `api.exportChatInviteLink`. Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.
@@ -1497,7 +1498,7 @@ class Context {
1497
1498
  return this.api.getMyDefaultAdministratorRights(other, signal);
1498
1499
  }
1499
1500
  /**
1500
- * Context-aware alias for `api.editMessageText`. Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1501
+ * Context-aware alias for `api.editMessageText`. Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1501
1502
  *
1502
1503
  * @param text New text of the message, 1-4096 characters after entities parsing
1503
1504
  * @param other Optional remaining parameters, confer the official reference below
@@ -1513,7 +1514,7 @@ class Context {
1513
1514
  : this.api.editMessageText(orThrow(this.chatId, "editMessageText"), orThrow((_d = (_b = (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_id) !== null && _b !== void 0 ? _b : (_c = this.messageReaction) === null || _c === void 0 ? void 0 : _c.message_id) !== null && _d !== void 0 ? _d : (_e = this.messageReactionCount) === null || _e === void 0 ? void 0 : _e.message_id, "editMessageText"), text, other, signal);
1514
1515
  }
1515
1516
  /**
1516
- * Context-aware alias for `api.editMessageCaption`. Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1517
+ * Context-aware alias for `api.editMessageCaption`. Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1517
1518
  *
1518
1519
  * @param other Optional remaining parameters, confer the official reference below
1519
1520
  * @param signal Optional `AbortSignal` to cancel the request
@@ -1528,7 +1529,7 @@ class Context {
1528
1529
  : this.api.editMessageCaption(orThrow(this.chatId, "editMessageCaption"), orThrow((_d = (_b = (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_id) !== null && _b !== void 0 ? _b : (_c = this.messageReaction) === null || _c === void 0 ? void 0 : _c.message_id) !== null && _d !== void 0 ? _d : (_e = this.messageReactionCount) === null || _e === void 0 ? void 0 : _e.message_id, "editMessageCaption"), other, signal);
1529
1530
  }
1530
1531
  /**
1531
- * Context-aware alias for `api.editMessageMedia`. Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1532
+ * Context-aware alias for `api.editMessageMedia`. Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1532
1533
  *
1533
1534
  * @param media An object for a new media content of the message
1534
1535
  * @param other Optional remaining parameters, confer the official reference below
@@ -1544,7 +1545,7 @@ class Context {
1544
1545
  : this.api.editMessageMedia(orThrow(this.chatId, "editMessageMedia"), orThrow((_d = (_b = (_a = this.msg) === null || _a === void 0 ? void 0 : _a.message_id) !== null && _b !== void 0 ? _b : (_c = this.messageReaction) === null || _c === void 0 ? void 0 : _c.message_id) !== null && _d !== void 0 ? _d : (_e = this.messageReactionCount) === null || _e === void 0 ? void 0 : _e.message_id, "editMessageMedia"), media, other, signal);
1545
1546
  }
1546
1547
  /**
1547
- * Context-aware alias for `api.editMessageReplyMarkup`. Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1548
+ * Context-aware alias for `api.editMessageReplyMarkup`. Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1548
1549
  *
1549
1550
  * @param other Optional remaining parameters, confer the official reference below
1550
1551
  * @param signal Optional `AbortSignal` to cancel the request
package/out/core/api.d.ts CHANGED
@@ -558,11 +558,12 @@ export declare class Api<R extends RawApi = RawApi> {
558
558
  *
559
559
  * @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
560
560
  * @param permissions New default chat permissions
561
+ * @param other Optional remaining parameters, confer the official reference below
561
562
  * @param signal Optional `AbortSignal` to cancel the request
562
563
  *
563
564
  * **Official reference:** https://core.telegram.org/bots/api#setchatpermissions
564
565
  */
565
- setChatPermissions(chat_id: number | string, permissions: ChatPermissions, signal?: AbortSignal): Promise<true>;
566
+ setChatPermissions(chat_id: number | string, permissions: ChatPermissions, other?: Other<R, "setChatPermissions", "chat_id" | "permissions">, signal?: AbortSignal): Promise<true>;
566
567
  /**
567
568
  * Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.
568
569
  *
@@ -1021,7 +1022,7 @@ export declare class Api<R extends RawApi = RawApi> {
1021
1022
  */
1022
1023
  getMyDefaultAdministratorRights(other?: Other<R, "getMyDefaultAdministratorRights">, signal?: AbortSignal): Promise<import("@grammyjs/types/manage.js").ChatAdministratorRights>;
1023
1024
  /**
1024
- * Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1025
+ * Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1025
1026
  *
1026
1027
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1027
1028
  * @param message_id Identifier of the message to edit
@@ -1035,7 +1036,7 @@ export declare class Api<R extends RawApi = RawApi> {
1035
1036
  text: string;
1036
1037
  })>;
1037
1038
  /**
1038
- * Use this method to edit text and game inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1039
+ * Use this method to edit text and game inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1039
1040
  *
1040
1041
  * @param inline_message_id Identifier of the inline message
1041
1042
  * @param other Optional remaining parameters, confer the official reference below
@@ -1047,7 +1048,7 @@ export declare class Api<R extends RawApi = RawApi> {
1047
1048
  text: string;
1048
1049
  })>;
1049
1050
  /**
1050
- * Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1051
+ * Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1051
1052
  *
1052
1053
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1053
1054
  * @param message_id Identifier of the message to edit
@@ -1058,7 +1059,7 @@ export declare class Api<R extends RawApi = RawApi> {
1058
1059
  */
1059
1060
  editMessageCaption(chat_id: number | string, message_id: number, other?: Other<R, "editMessageCaption", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update.js").Update.Edited & import("@grammyjs/types/message.js").Message.CaptionableMessage)>;
1060
1061
  /**
1061
- * Use this method to edit captions of inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1062
+ * Use this method to edit captions of inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1062
1063
  *
1063
1064
  * @param inline_message_id Identifier of the inline message
1064
1065
  * @param other Optional remaining parameters, confer the official reference below
@@ -1068,7 +1069,7 @@ export declare class Api<R extends RawApi = RawApi> {
1068
1069
  */
1069
1070
  editMessageCaptionInline(inline_message_id: string, other?: Other<R, "editMessageCaption", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update.js").Update.Edited & import("@grammyjs/types/message.js").Message.CaptionableMessage)>;
1070
1071
  /**
1071
- * Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1072
+ * Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1072
1073
  *
1073
1074
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1074
1075
  * @param message_id Identifier of the message to edit
@@ -1080,7 +1081,7 @@ export declare class Api<R extends RawApi = RawApi> {
1080
1081
  */
1081
1082
  editMessageMedia(chat_id: number | string, message_id: number, media: InputMedia, other?: Other<R, "editMessageMedia", "chat_id" | "message_id" | "inline_message_id" | "media">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update.js").Update.Edited & import("@grammyjs/types/message.js").Message)>;
1082
1083
  /**
1083
- * Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1084
+ * Use this method to edit animation, audio, document, photo, or video inline messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1084
1085
  *
1085
1086
  * @param inline_message_id Identifier of the inline message
1086
1087
  * @param media An object for a new media content of the message
@@ -1091,7 +1092,7 @@ export declare class Api<R extends RawApi = RawApi> {
1091
1092
  */
1092
1093
  editMessageMediaInline(inline_message_id: string, media: InputMedia, other?: Other<R, "editMessageMedia", "chat_id" | "message_id" | "inline_message_id" | "media">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update.js").Update.Edited & import("@grammyjs/types/message.js").Message)>;
1093
1094
  /**
1094
- * Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1095
+ * Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1095
1096
  *
1096
1097
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1097
1098
  * @param message_id Identifier of the message to edit
@@ -1102,7 +1103,7 @@ export declare class Api<R extends RawApi = RawApi> {
1102
1103
  */
1103
1104
  editMessageReplyMarkup(chat_id: number | string, message_id: number, other?: Other<R, "editMessageReplyMarkup", "chat_id" | "message_id" | "inline_message_id">, signal?: AbortSignal): Promise<true | (import("@grammyjs/types/update.js").Update.Edited & import("@grammyjs/types/message.js").Message)>;
1104
1105
  /**
1105
- * Use this method to edit only the reply markup of inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1106
+ * Use this method to edit only the reply markup of inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1106
1107
  *
1107
1108
  * @param inline_message_id Identifier of the inline message
1108
1109
  * @param other Optional remaining parameters, confer the official reference below
@@ -1392,6 +1393,15 @@ export declare class Api<R extends RawApi = RawApi> {
1392
1393
  * **Official reference:** https://core.telegram.org/bots/api#answerprecheckoutquery
1393
1394
  */
1394
1395
  answerPreCheckoutQuery(pre_checkout_query_id: string, ok: boolean, other?: Other<R, "answerPreCheckoutQuery", "pre_checkout_query_id" | "ok">, signal?: AbortSignal): Promise<true>;
1396
+ /**
1397
+ * Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object.
1398
+ *
1399
+ * @param other Optional remaining parameters, confer the official reference below
1400
+ * @param signal Optional `AbortSignal` to cancel the request
1401
+ *
1402
+ * **Official reference:** https://core.telegram.org/bots/api#getstartransactions
1403
+ */
1404
+ getStarTransactions(other?: Other<R, "getStarTransactions">, signal?: AbortSignal): Promise<import("@grammyjs/types/payment.js").StarTransactions>;
1395
1405
  /**
1396
1406
  * Refunds a successful payment in Telegram Stars.
1397
1407
  *
package/out/core/api.js CHANGED
@@ -620,12 +620,13 @@ class Api {
620
620
  *
621
621
  * @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
622
622
  * @param permissions New default chat permissions
623
+ * @param other Optional remaining parameters, confer the official reference below
623
624
  * @param signal Optional `AbortSignal` to cancel the request
624
625
  *
625
626
  * **Official reference:** https://core.telegram.org/bots/api#setchatpermissions
626
627
  */
627
- setChatPermissions(chat_id, permissions, signal) {
628
- return this.raw.setChatPermissions({ chat_id, permissions }, signal);
628
+ setChatPermissions(chat_id, permissions, other, signal) {
629
+ return this.raw.setChatPermissions({ chat_id, permissions, ...other }, signal);
629
630
  }
630
631
  /**
631
632
  * Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.
@@ -1181,7 +1182,7 @@ class Api {
1181
1182
  return this.raw.getMyDefaultAdministratorRights({ ...other }, signal);
1182
1183
  }
1183
1184
  /**
1184
- * Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1185
+ * Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1185
1186
  *
1186
1187
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1187
1188
  * @param message_id Identifier of the message to edit
@@ -1195,7 +1196,7 @@ class Api {
1195
1196
  return this.raw.editMessageText({ chat_id, message_id, text, ...other }, signal);
1196
1197
  }
1197
1198
  /**
1198
- * Use this method to edit text and game inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1199
+ * Use this method to edit text and game inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1199
1200
  *
1200
1201
  * @param inline_message_id Identifier of the inline message
1201
1202
  * @param other Optional remaining parameters, confer the official reference below
@@ -1207,7 +1208,7 @@ class Api {
1207
1208
  return this.raw.editMessageText({ inline_message_id, text, ...other }, signal);
1208
1209
  }
1209
1210
  /**
1210
- * Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1211
+ * Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1211
1212
  *
1212
1213
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1213
1214
  * @param message_id Identifier of the message to edit
@@ -1220,7 +1221,7 @@ class Api {
1220
1221
  return this.raw.editMessageCaption({ chat_id, message_id, ...other }, signal);
1221
1222
  }
1222
1223
  /**
1223
- * Use this method to edit captions of inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1224
+ * Use this method to edit captions of inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1224
1225
  *
1225
1226
  * @param inline_message_id Identifier of the inline message
1226
1227
  * @param other Optional remaining parameters, confer the official reference below
@@ -1232,7 +1233,7 @@ class Api {
1232
1233
  return this.raw.editMessageCaption({ inline_message_id, ...other }, signal);
1233
1234
  }
1234
1235
  /**
1235
- * Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1236
+ * Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1236
1237
  *
1237
1238
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1238
1239
  * @param message_id Identifier of the message to edit
@@ -1246,7 +1247,7 @@ class Api {
1246
1247
  return this.raw.editMessageMedia({ chat_id, message_id, media, ...other }, signal);
1247
1248
  }
1248
1249
  /**
1249
- * Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1250
+ * Use this method to edit animation, audio, document, photo, or video inline messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1250
1251
  *
1251
1252
  * @param inline_message_id Identifier of the inline message
1252
1253
  * @param media An object for a new media content of the message
@@ -1259,7 +1260,7 @@ class Api {
1259
1260
  return this.raw.editMessageMedia({ inline_message_id, media, ...other }, signal);
1260
1261
  }
1261
1262
  /**
1262
- * Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1263
+ * Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1263
1264
  *
1264
1265
  * @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1265
1266
  * @param message_id Identifier of the message to edit
@@ -1272,7 +1273,7 @@ class Api {
1272
1273
  return this.raw.editMessageReplyMarkup({ chat_id, message_id, ...other }, signal);
1273
1274
  }
1274
1275
  /**
1275
- * Use this method to edit only the reply markup of inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
1276
+ * Use this method to edit only the reply markup of inline messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
1276
1277
  *
1277
1278
  * @param inline_message_id Identifier of the inline message
1278
1279
  * @param other Optional remaining parameters, confer the official reference below
@@ -1633,6 +1634,17 @@ class Api {
1633
1634
  answerPreCheckoutQuery(pre_checkout_query_id, ok, other, signal) {
1634
1635
  return this.raw.answerPreCheckoutQuery({ pre_checkout_query_id, ok, ...other }, signal);
1635
1636
  }
1637
+ /**
1638
+ * Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object.
1639
+ *
1640
+ * @param other Optional remaining parameters, confer the official reference below
1641
+ * @param signal Optional `AbortSignal` to cancel the request
1642
+ *
1643
+ * **Official reference:** https://core.telegram.org/bots/api#getstartransactions
1644
+ */
1645
+ getStarTransactions(other, signal) {
1646
+ return this.raw.getStarTransactions({ ...other }, signal);
1647
+ }
1636
1648
  /**
1637
1649
  * Refunds a successful payment in Telegram Stars.
1638
1650
  *
package/out/web.mjs CHANGED
@@ -861,8 +861,8 @@ class Context {
861
861
  unbanChatSenderChat(sender_chat_id, signal) {
862
862
  return this.api.unbanChatSenderChat(orThrow(this.chatId, "unbanChatSenderChat"), sender_chat_id, signal);
863
863
  }
864
- setChatPermissions(permissions, signal) {
865
- return this.api.setChatPermissions(orThrow(this.chatId, "setChatPermissions"), permissions, signal);
864
+ setChatPermissions(permissions, other, signal) {
865
+ return this.api.setChatPermissions(orThrow(this.chatId, "setChatPermissions"), permissions, other, signal);
866
866
  }
867
867
  exportChatInviteLink(signal) {
868
868
  return this.api.exportChatInviteLink(orThrow(this.chatId, "exportChatInviteLink"), signal);
@@ -2662,10 +2662,11 @@ class Api {
2662
2662
  sender_chat_id
2663
2663
  }, signal);
2664
2664
  }
2665
- setChatPermissions(chat_id, permissions, signal) {
2665
+ setChatPermissions(chat_id, permissions, other, signal) {
2666
2666
  return this.raw.setChatPermissions({
2667
2667
  chat_id,
2668
- permissions
2668
+ permissions,
2669
+ ...other
2669
2670
  }, signal);
2670
2671
  }
2671
2672
  exportChatInviteLink(chat_id, signal) {
@@ -3156,6 +3157,11 @@ class Api {
3156
3157
  ...other
3157
3158
  }, signal);
3158
3159
  }
3160
+ getStarTransactions(other, signal) {
3161
+ return this.raw.getStarTransactions({
3162
+ ...other
3163
+ }, signal);
3164
+ }
3159
3165
  refundStarPayment(user_id, telegram_payment_charge_id, signal) {
3160
3166
  return this.raw.refundStarPayment({
3161
3167
  user_id,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "grammy",
3
3
  "description": "The Telegram Bot Framework.",
4
- "version": "1.24.1",
4
+ "version": "1.25.0",
5
5
  "author": "KnorpelSenf",
6
6
  "license": "MIT",
7
7
  "engines": {
@@ -17,7 +17,7 @@
17
17
  "backport": "deno2node tsconfig.json"
18
18
  },
19
19
  "dependencies": {
20
- "@grammyjs/types": "3.8.0",
20
+ "@grammyjs/types": "3.9.0",
21
21
  "abort-controller": "^3.0.0",
22
22
  "debug": "^4.3.4",
23
23
  "node-fetch": "^2.7.0"