grammy 1.40.0 β†’ 1.41.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-9.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-9.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-)
@@ -262,7 +262,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
262
262
  <td align="center" valign="top" width="11.11%"><a href="https://github.com/AbbassAlmusawi"><img src="https://avatars.githubusercontent.com/u/73327881?v=4?s=100" width="100px;" alt="Abbass Al-Musawi"/><br /><sub><b>Abbass Al-Musawi</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=AbbassAlmusawi" title="Documentation">πŸ“–</a> <a href="https://github.com/grammyjs/grammY/issues?q=author%3AAbbassAlmusawi" title="Bug reports">πŸ›</a> <a href="https://github.com/grammyjs/grammY/commits?author=AbbassAlmusawi" title="Code">πŸ’»</a></td>
263
263
  </tr>
264
264
  <tr>
265
- <td align="center" valign="top" width="11.11%"><a href="https://github.com/inji-gg"><img src="https://avatars.githubusercontent.com/u/5071242?v=4?s=100" width="100px;" alt="ArunR"/><br /><sub><b>ArunR</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Ainji-gg" title="Bug reports">πŸ›</a> <a href="https://github.com/grammyjs/grammY/commits?author=inji-gg" title="Code">πŸ’»</a></td>
265
+ <td align="center" valign="top" width="11.11%"><a href="https://github.com/arunr-inji"><img src="https://avatars.githubusercontent.com/u/5071242?v=4?s=100" width="100px;" alt="ArunR"/><br /><sub><b>ArunR</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Aarunr-inji" title="Bug reports">πŸ›</a> <a href="https://github.com/grammyjs/grammY/commits?author=arunr-inji" title="Code">πŸ’»</a> <a href="#ideas-arunr-inji" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="https://github.com/grammyjs/grammY/commits?author=arunr-inji" title="Tests">⚠️</a></td>
266
266
  <td align="center" valign="top" width="11.11%"><a href="https://github.com/ndatg"><img src="https://avatars.githubusercontent.com/u/108090198?v=4?s=100" width="100px;" alt="NDA"/><br /><sub><b>NDA</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Andatg" title="Bug reports">πŸ›</a> <a href="#ideas-ndatg" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="https://github.com/grammyjs/grammY/commits?author=ndatg" title="Code">πŸ’»</a></td>
267
267
  <td align="center" valign="top" width="11.11%"><a href="https://github.com/MatyiFKBT"><img src="https://avatars.githubusercontent.com/u/6183867?v=4?s=100" width="100px;" alt="MatyiFKBT"/><br /><sub><b>MatyiFKBT</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/commits?author=MatyiFKBT" title="Documentation">πŸ“–</a></td>
268
268
  <td align="center" valign="top" width="11.11%"><a href="https://chrisandrew.cl"><img src="https://avatars.githubusercontent.com/u/368831?v=4?s=100" width="100px;" alt="Chris Andrew C. L."/><br /><sub><b>Chris Andrew C. L.</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Achrisandrewcl" title="Bug reports">πŸ›</a> <a href="https://github.com/grammyjs/grammY/commits?author=chrisandrewcl" title="Code">πŸ’»</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Achrisandrewcl" title="Reviewed Pull Requests">πŸ‘€</a></td>
@@ -332,8 +332,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
332
332
  <td align="center" valign="top" width="11.11%"><a href="https://github.com/OfficialCodinary"><img src="https://avatars.githubusercontent.com/u/133005277?v=4?s=100" width="100px;" alt="Codinary"/><br /><sub><b>Codinary</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3AOfficialCodinary" title="Reviewed Pull Requests">πŸ‘€</a></td>
333
333
  <td align="center" valign="top" width="11.11%"><a href="https://github.com/dotvhs"><img src="https://avatars.githubusercontent.com/u/681416?v=4?s=100" width="100px;" alt=".vhs"/><br /><sub><b>.vhs</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Adotvhs" title="Bug reports">πŸ›</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Adotvhs" title="Reviewed Pull Requests">πŸ‘€</a></td>
334
334
  <td align="center" valign="top" width="11.11%"><a href="https://agou.im/"><img src="https://avatars.githubusercontent.com/u/55237525?v=4?s=100" width="100px;" alt="agoudbg"/><br /><sub><b>agoudbg</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Aagoudbg" title="Bug reports">πŸ›</a> <a href="https://github.com/grammyjs/grammY/commits?author=agoudbg" title="Code">πŸ’»</a></td>
335
- <td align="center" valign="top" width="11.11%"><a href="https://github.com/arunr-inji"><img src="https://avatars.githubusercontent.com/u/5071242?v=4?s=100" width="100px;" alt="ArunR"/><br /><sub><b>ArunR</b></sub></a><br /><a href="#ideas-arunr-inji" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="https://github.com/grammyjs/grammY/commits?author=arunr-inji" title="Code">πŸ’»</a> <a href="https://github.com/grammyjs/grammY/commits?author=arunr-inji" title="Tests">⚠️</a></td>
336
335
  <td align="center" valign="top" width="11.11%"><a href="https://github.com/crwnd"><img src="https://avatars.githubusercontent.com/u/97118277?v=4?s=100" width="100px;" alt="A"/><br /><sub><b>A</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Acrwnd" title="Bug reports">πŸ›</a> <a href="https://github.com/grammyjs/grammY/pulls?q=is%3Apr+reviewed-by%3Acrwnd" title="Reviewed Pull Requests">πŸ‘€</a></td>
336
+ <td align="center" valign="top" width="11.11%"><a href="http://www.linkedin.com/in/huntharo/"><img src="https://avatars.githubusercontent.com/u/5617868?v=4?s=100" width="100px;" alt="Harold Hunt"/><br /><sub><b>Harold Hunt</b></sub></a><br /><a href="https://github.com/grammyjs/grammY/issues?q=author%3Ahuntharo" title="Bug reports">πŸ›</a> <a href="https://github.com/grammyjs/grammY/commits?author=huntharo" title="Code">πŸ’»</a> <a href="https://github.com/grammyjs/grammY/commits?author=huntharo" title="Tests">⚠️</a></td>
337
337
  </tr>
338
338
  </tbody>
339
339
  </table>
package/out/context.d.ts CHANGED
@@ -473,7 +473,7 @@ export declare class Context implements RenamedUpdate {
473
473
  */
474
474
  reply(text: string, other?: Other<"sendMessage", "chat_id" | "text">, signal?: AbortSignal): Promise<Message.TextMessage>;
475
475
  /**
476
- * Context-aware alias for `api.sendMessageDraft`. Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success.
476
+ * Context-aware alias for `api.sendMessageDraft`. Use this method to stream a partial message to a user while the message is being generated. Returns True on success.
477
477
  *
478
478
  * @param text Text of the message to be sent, 1-4096 characters after entities parsing
479
479
  * @param other Optional remaining parameters, confer the official reference below
@@ -905,6 +905,25 @@ export declare class Context implements RenamedUpdate {
905
905
  * **Official reference:** https://core.telegram.org/bots/api#setchatadministratorcustomtitle
906
906
  */
907
907
  setChatAdministratorCustomTitle(user_id: number, custom_title: string, signal?: AbortSignal): Promise<true>;
908
+ /**
909
+ * Context-aware alias for `api.setChatMemberTag`. Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the β€œcan_manage_tags” administrator right. Returns True on success.
910
+ *
911
+ * @param tag New tag for the member; 0-16 characters, emoji are not allowed
912
+ * @param signal Optional `AbortSignal` to cancel the request
913
+ *
914
+ * **Official reference:** https://core.telegram.org/bots/api#setChatMemberTag
915
+ */
916
+ setAuthorTag(tag: string, signal?: AbortSignal): Promise<true>;
917
+ /**
918
+ * Context-aware alias for `api.setChatMemberTag`. Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the β€œcan_manage_tags” administrator right. Returns True on success.
919
+ *
920
+ * @param user_id Unique identifier of the target user
921
+ * @param tag New tag for the member; 0-16 characters, emoji are not allowed
922
+ * @param signal Optional `AbortSignal` to cancel the request
923
+ *
924
+ * **Official reference:** https://core.telegram.org/bots/api#setChatMemberTag
925
+ */
926
+ setChatMemberTag(user_id: number, tag: string, signal?: AbortSignal): Promise<true>;
908
927
  /**
909
928
  * Context-aware alias for `api.banChatSenderChat`. Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.
910
929
  *
package/out/context.js CHANGED
@@ -678,7 +678,7 @@ class Context {
678
678
  }, signal);
679
679
  }
680
680
  /**
681
- * Context-aware alias for `api.sendMessageDraft`. Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success.
681
+ * Context-aware alias for `api.sendMessageDraft`. Use this method to stream a partial message to a user while the message is being generated. Returns True on success.
682
682
  *
683
683
  * @param text Text of the message to be sent, 1-4096 characters after entities parsing
684
684
  * @param other Optional remaining parameters, confer the official reference below
@@ -1368,6 +1368,29 @@ class Context {
1368
1368
  setChatAdministratorCustomTitle(user_id, custom_title, signal) {
1369
1369
  return this.api.setChatAdministratorCustomTitle(orThrow(this.chatId, "setChatAdministratorCustomTitle"), user_id, custom_title, signal);
1370
1370
  }
1371
+ /**
1372
+ * Context-aware alias for `api.setChatMemberTag`. Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the β€œcan_manage_tags” administrator right. Returns True on success.
1373
+ *
1374
+ * @param tag New tag for the member; 0-16 characters, emoji are not allowed
1375
+ * @param signal Optional `AbortSignal` to cancel the request
1376
+ *
1377
+ * **Official reference:** https://core.telegram.org/bots/api#setChatMemberTag
1378
+ */
1379
+ setAuthorTag(tag, signal) {
1380
+ return this.api.setChatMemberTag(orThrow(this.chatId, "setChatMemberTag"), orThrow(this.from, "setChatMemberTag").id, tag, signal);
1381
+ }
1382
+ /**
1383
+ * Context-aware alias for `api.setChatMemberTag`. Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the β€œcan_manage_tags” administrator right. Returns True on success.
1384
+ *
1385
+ * @param user_id Unique identifier of the target user
1386
+ * @param tag New tag for the member; 0-16 characters, emoji are not allowed
1387
+ * @param signal Optional `AbortSignal` to cancel the request
1388
+ *
1389
+ * **Official reference:** https://core.telegram.org/bots/api#setChatMemberTag
1390
+ */
1391
+ setChatMemberTag(user_id, tag, signal) {
1392
+ return this.api.setChatMemberTag(orThrow(this.chatId, "setChatMemberTag"), user_id, tag, signal);
1393
+ }
1371
1394
  /**
1372
1395
  * Context-aware alias for `api.banChatSenderChat`. Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.
1373
1396
  *
@@ -1,19 +1,19 @@
1
1
  import { DEFAULT_UPDATE_TYPES } from "../bot.js";
2
2
  declare const ALL_UPDATE_TYPES: readonly ["message", "edited_message", "channel_post", "edited_channel_post", "business_connection", "business_message", "edited_business_message", "deleted_business_messages", "inline_query", "chosen_inline_result", "callback_query", "shipping_query", "pre_checkout_query", "purchased_paid_media", "poll", "poll_answer", "my_chat_member", "chat_join_request", "chat_boost", "removed_chat_boost", "chat_member", "message_reaction", "message_reaction_count"];
3
3
  declare const ALL_CHAT_PERMISSIONS: {
4
- readonly is_anonymous: true;
5
- readonly can_manage_chat: true;
6
- readonly can_delete_messages: true;
7
- readonly can_manage_video_chats: true;
8
- readonly can_restrict_members: true;
9
- readonly can_promote_members: true;
4
+ readonly can_send_messages: true;
5
+ readonly can_send_audios: true;
6
+ readonly can_send_documents: true;
7
+ readonly can_send_photos: true;
8
+ readonly can_send_videos: true;
9
+ readonly can_send_video_notes: true;
10
+ readonly can_send_voice_notes: true;
11
+ readonly can_send_polls: true;
12
+ readonly can_send_other_messages: true;
13
+ readonly can_add_web_page_previews: true;
10
14
  readonly can_change_info: true;
11
15
  readonly can_invite_users: true;
12
- readonly can_post_stories: true;
13
- readonly can_edit_stories: true;
14
- readonly can_delete_stories: true;
15
- readonly can_post_messages: true;
16
- readonly can_edit_messages: true;
16
+ readonly can_edit_tag: true;
17
17
  readonly can_pin_messages: true;
18
18
  readonly can_manage_topics: true;
19
19
  };
@@ -77,7 +77,7 @@ export interface ApiConstants {
77
77
  * await ctx.restrictAuthor(ALL_CHAT_PERMISSIONS);
78
78
  * ```
79
79
  *
80
- * See the [Bot API reference](https://core.telegram.org/bots/api#update)
80
+ * See the [Bot API reference](https://core.telegram.org/bots/api#chatpermissions)
81
81
  * for more information.
82
82
  */
83
83
  ALL_CHAT_PERMISSIONS: keyof typeof ALL_CHAT_PERMISSIONS;
@@ -9,19 +9,19 @@ const ALL_UPDATE_TYPES = [
9
9
  "message_reaction_count",
10
10
  ];
11
11
  const ALL_CHAT_PERMISSIONS = {
12
- is_anonymous: true,
13
- can_manage_chat: true,
14
- can_delete_messages: true,
15
- can_manage_video_chats: true,
16
- can_restrict_members: true,
17
- can_promote_members: true,
12
+ can_send_messages: true,
13
+ can_send_audios: true,
14
+ can_send_documents: true,
15
+ can_send_photos: true,
16
+ can_send_videos: true,
17
+ can_send_video_notes: true,
18
+ can_send_voice_notes: true,
19
+ can_send_polls: true,
20
+ can_send_other_messages: true,
21
+ can_add_web_page_previews: true,
18
22
  can_change_info: true,
19
23
  can_invite_users: true,
20
- can_post_stories: true,
21
- can_edit_stories: true,
22
- can_delete_stories: true,
23
- can_post_messages: true,
24
- can_edit_messages: true,
24
+ can_edit_tag: true,
25
25
  can_pin_messages: true,
26
26
  can_manage_topics: true,
27
27
  };
@@ -204,7 +204,12 @@ const http = (req, res) => {
204
204
  // @ts-ignore `Buffer` is Node-only
205
205
  // deno-lint-ignore no-node-globals
206
206
  const raw = Buffer.concat(chunks).toString("utf-8");
207
- resolve(JSON.parse(raw));
207
+ try {
208
+ resolve(JSON.parse(raw));
209
+ }
210
+ catch (err) {
211
+ reject(err);
212
+ }
208
213
  })
209
214
  .once("error", reject);
210
215
  });
package/out/core/api.d.ts CHANGED
@@ -155,7 +155,7 @@ export declare class Api<R extends RawApi = RawApi> {
155
155
  */
156
156
  sendMessage(chat_id: number | string, text: string, other?: Other<R, "sendMessage", "chat_id" | "text">, signal?: AbortSignal): Promise<import("@grammyjs/types/message.js").Message.TextMessage>;
157
157
  /**
158
- * Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success.
158
+ * Use this method to stream a partial message to a user while the message is being generated. Returns True on success.
159
159
  *
160
160
  * @param chat_id Unique identifier for the target private chat
161
161
  * @param draft_id Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated
@@ -622,6 +622,17 @@ export declare class Api<R extends RawApi = RawApi> {
622
622
  * **Official reference:** https://core.telegram.org/bots/api#setchatadministratorcustomtitle
623
623
  */
624
624
  setChatAdministratorCustomTitle(chat_id: number | string, user_id: number, custom_title: string, signal?: AbortSignal): Promise<true>;
625
+ /**
626
+ * Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the β€œcan_manage_tags” administrator right. Returns True on success.
627
+ *
628
+ * @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
629
+ * @param user_id Unique identifier of the target user
630
+ * @param tag New tag for the member; 0-16 characters, emoji are not allowed
631
+ * @param signal Optional `AbortSignal` to cancel the request
632
+ *
633
+ * **Official reference:** https://core.telegram.org/bots/api#setChatMemberTag
634
+ */
635
+ setChatMemberTag(chat_id: number | string, user_id: number, tag: string, signal?: AbortSignal): Promise<true>;
625
636
  /**
626
637
  * Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.
627
638
  *
package/out/core/api.js CHANGED
@@ -140,7 +140,7 @@ class Api {
140
140
  return this.raw.sendMessage({ chat_id, text, ...other }, signal);
141
141
  }
142
142
  /**
143
- * Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success.
143
+ * Use this method to stream a partial message to a user while the message is being generated. Returns True on success.
144
144
  *
145
145
  * @param chat_id Unique identifier for the target private chat
146
146
  * @param draft_id Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated
@@ -708,6 +708,19 @@ class Api {
708
708
  setChatAdministratorCustomTitle(chat_id, user_id, custom_title, signal) {
709
709
  return this.raw.setChatAdministratorCustomTitle({ chat_id, user_id, custom_title }, signal);
710
710
  }
711
+ /**
712
+ * Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the β€œcan_manage_tags” administrator right. Returns True on success.
713
+ *
714
+ * @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
715
+ * @param user_id Unique identifier of the target user
716
+ * @param tag New tag for the member; 0-16 characters, emoji are not allowed
717
+ * @param signal Optional `AbortSignal` to cancel the request
718
+ *
719
+ * **Official reference:** https://core.telegram.org/bots/api#setChatMemberTag
720
+ */
721
+ setChatMemberTag(chat_id, user_id, tag, signal) {
722
+ return this.raw.setChatMemberTag({ chat_id, user_id, tag }, signal);
723
+ }
711
724
  /**
712
725
  * Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.
713
726
  *
package/out/web.mjs CHANGED
@@ -1074,6 +1074,12 @@ class Context {
1074
1074
  setChatAdministratorCustomTitle(user_id, custom_title, signal) {
1075
1075
  return this.api.setChatAdministratorCustomTitle(orThrow(this.chatId, "setChatAdministratorCustomTitle"), user_id, custom_title, signal);
1076
1076
  }
1077
+ setAuthorTag(tag, signal) {
1078
+ return this.api.setChatMemberTag(orThrow(this.chatId, "setChatMemberTag"), orThrow(this.from, "setChatMemberTag").id, tag, signal);
1079
+ }
1080
+ setChatMemberTag(user_id, tag, signal) {
1081
+ return this.api.setChatMemberTag(orThrow(this.chatId, "setChatMemberTag"), user_id, tag, signal);
1082
+ }
1077
1083
  banChatSenderChat(sender_chat_id, signal) {
1078
1084
  return this.api.banChatSenderChat(orThrow(this.chatId, "banChatSenderChat"), sender_chat_id, signal);
1079
1085
  }
@@ -3120,6 +3126,13 @@ class Api {
3120
3126
  custom_title
3121
3127
  }, signal);
3122
3128
  }
3129
+ setChatMemberTag(chat_id, user_id, tag, signal) {
3130
+ return this.raw.setChatMemberTag({
3131
+ chat_id,
3132
+ user_id,
3133
+ tag
3134
+ }, signal);
3135
+ }
3123
3136
  banChatSenderChat(chat_id, sender_chat_id, signal) {
3124
3137
  return this.raw.banChatSenderChat({
3125
3138
  chat_id,
@@ -4245,19 +4258,19 @@ const ALL_UPDATE_TYPES = [
4245
4258
  "message_reaction_count"
4246
4259
  ];
4247
4260
  const ALL_CHAT_PERMISSIONS = {
4248
- is_anonymous: true,
4249
- can_manage_chat: true,
4250
- can_delete_messages: true,
4251
- can_manage_video_chats: true,
4252
- can_restrict_members: true,
4253
- can_promote_members: true,
4261
+ can_send_messages: true,
4262
+ can_send_audios: true,
4263
+ can_send_documents: true,
4264
+ can_send_photos: true,
4265
+ can_send_videos: true,
4266
+ can_send_video_notes: true,
4267
+ can_send_voice_notes: true,
4268
+ can_send_polls: true,
4269
+ can_send_other_messages: true,
4270
+ can_add_web_page_previews: true,
4254
4271
  can_change_info: true,
4255
4272
  can_invite_users: true,
4256
- can_post_stories: true,
4257
- can_edit_stories: true,
4258
- can_delete_stories: true,
4259
- can_post_messages: true,
4260
- can_edit_messages: true,
4273
+ can_edit_tag: true,
4261
4274
  can_pin_messages: true,
4262
4275
  can_manage_topics: true
4263
4276
  };
@@ -5577,7 +5590,11 @@ const http = (req, res)=>{
5577
5590
  const chunks = [];
5578
5591
  req.on("data", (chunk)=>chunks.push(chunk)).once("end", ()=>{
5579
5592
  const raw = Buffer.concat(chunks).toString("utf-8");
5580
- resolve(JSON.parse(raw));
5593
+ try {
5594
+ resolve(JSON.parse(raw));
5595
+ } catch (err) {
5596
+ reject(err);
5597
+ }
5581
5598
  }).once("error", reject);
5582
5599
  });
5583
5600
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "grammy",
3
3
  "description": "The Telegram Bot Framework.",
4
- "version": "1.40.0",
4
+ "version": "1.41.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.24.0",
20
+ "@grammyjs/types": "3.25.0",
21
21
  "abort-controller": "^3.0.0",
22
22
  "debug": "^4.4.3",
23
23
  "node-fetch": "^2.7.0"