grammy 1.26.0 → 1.27.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.6-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.7-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-)
package/out/composer.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type CallbackQueryContext, type ChatTypeContext, type ChosenInlineResultContext, type CommandContext, Context, type GameQueryContext, type HearsContext, type InlineQueryContext, type MaybeArray, type PreCheckoutQueryContext, type ReactionContext, type ShippingQueryContext, type StringWithSuggestions } from "./context.js";
1
+ import { type CallbackQueryContext, type ChatTypeContext, type ChosenInlineResultContext, type CommandContext, Context, type GameQueryContext, type HearsContext, type InlineQueryContext, type MaybeArray, type PreCheckoutQueryContext, type ReactionContext, type ShippingQueryContext, type StringWithCommandSuggestions } from "./context.js";
2
2
  import { type Filter, type FilterQuery } from "./filter.js";
3
3
  import { type Chat, type ReactionType, type ReactionTypeEmoji } from "./types.js";
4
4
  type MaybePromise<T> = T | Promise<T>;
@@ -267,7 +267,7 @@ export declare class Composer<C extends Context> implements MiddlewareObj<C> {
267
267
  * @param command The command to look for
268
268
  * @param middleware The middleware to register
269
269
  */
270
- command<S extends string>(command: MaybeArray<StringWithSuggestions<S | "start" | "help" | "settings">>, ...middleware: Array<CommandMiddleware<C>>): Composer<CommandContext<C>>;
270
+ command(command: MaybeArray<StringWithCommandSuggestions>, ...middleware: Array<CommandMiddleware<C>>): Composer<CommandContext<C>>;
271
271
  /**
272
272
  * Registers some middleware that will only be added when a new reaction of
273
273
  * the given type is added to a message.
package/out/context.d.ts CHANGED
@@ -3,7 +3,8 @@ import { type Methods, type RawApi } from "./core/client.js";
3
3
  import { type Filter, type FilterCore, type FilterQuery } from "./filter.js";
4
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";
5
5
  export type MaybeArray<T> = T | T[];
6
- export type StringWithSuggestions<S extends string> = (string & Record<never, never>) | S;
6
+ /** permits `string` but gives hints */
7
+ export type StringWithCommandSuggestions = (string & Record<never, never>) | "start" | "help" | "settings" | "privacy";
7
8
  type Other<M extends Methods<RawApi>, X extends string = never> = OtherApi<RawApi, M, X>;
8
9
  type SnakeToCamelCase<S extends string> = S extends `${infer L}_${infer R}` ? `${L}${Capitalize<SnakeToCamelCase<R>>}` : S;
9
10
  type AliasProps<U> = {
@@ -32,7 +33,7 @@ interface StaticHas {
32
33
  *
33
34
  * @param command The command to match
34
35
  */
35
- command<S extends string>(command: MaybeArray<StringWithSuggestions<S | "start" | "help" | "settings">>): <C extends Context>(ctx: C) => ctx is CommandContext<C>;
36
+ command(command: MaybeArray<StringWithCommandSuggestions>): <C extends Context>(ctx: C) => ctx is CommandContext<C>;
36
37
  /**
37
38
  * Generates a predicate function that can test context objects for
38
39
  * containing a message reaction update. This uses the same logic as
@@ -383,7 +384,7 @@ export declare class Context implements RenamedUpdate {
383
384
  *
384
385
  * @param command The command to match
385
386
  */
386
- hasCommand<S extends string>(command: MaybeArray<StringWithSuggestions<S | "start" | "help" | "settings">>): this is CommandContextCore;
387
+ hasCommand(command: MaybeArray<StringWithCommandSuggestions>): this is CommandContextCore;
387
388
  hasReaction(reaction: MaybeArray<ReactionTypeEmoji["emoji"] | ReactionType>): this is ReactionContextCore;
388
389
  /**
389
390
  * Returns `true` if this context object belongs to a chat with the given
package/out/filter.d.ts CHANGED
@@ -47,6 +47,7 @@ declare const UPDATE_KEYS: {
47
47
  readonly migrate_to_chat_id: {};
48
48
  readonly migrate_from_chat_id: {};
49
49
  readonly successful_payment: {};
50
+ readonly refunded_payment: {};
50
51
  readonly boost_added: {};
51
52
  readonly users_shared: {};
52
53
  readonly chat_shared: {};
@@ -170,6 +171,7 @@ declare const UPDATE_KEYS: {
170
171
  readonly migrate_to_chat_id: {};
171
172
  readonly migrate_from_chat_id: {};
172
173
  readonly successful_payment: {};
174
+ readonly refunded_payment: {};
173
175
  readonly boost_added: {};
174
176
  readonly users_shared: {};
175
177
  readonly chat_shared: {};
@@ -479,6 +481,7 @@ declare const UPDATE_KEYS: {
479
481
  readonly migrate_to_chat_id: {};
480
482
  readonly migrate_from_chat_id: {};
481
483
  readonly successful_payment: {};
484
+ readonly refunded_payment: {};
482
485
  readonly boost_added: {};
483
486
  readonly users_shared: {};
484
487
  readonly chat_shared: {};
@@ -602,6 +605,7 @@ declare const UPDATE_KEYS: {
602
605
  readonly migrate_to_chat_id: {};
603
606
  readonly migrate_from_chat_id: {};
604
607
  readonly successful_payment: {};
608
+ readonly refunded_payment: {};
605
609
  readonly boost_added: {};
606
610
  readonly users_shared: {};
607
611
  readonly chat_shared: {};
package/out/filter.js CHANGED
@@ -295,6 +295,7 @@ const MESSAGE_KEYS = {
295
295
  migrate_to_chat_id: {},
296
296
  migrate_from_chat_id: {},
297
297
  successful_payment: {},
298
+ refunded_payment: {},
298
299
  boost_added: {},
299
300
  users_shared: {},
300
301
  chat_shared: {},
package/out/web.mjs CHANGED
@@ -240,6 +240,7 @@ const MESSAGE_KEYS = {
240
240
  migrate_to_chat_id: {},
241
241
  migrate_from_chat_id: {},
242
242
  successful_payment: {},
243
+ refunded_payment: {},
243
244
  boost_added: {},
244
245
  users_shared: {},
245
246
  chat_shared: {},
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "grammy",
3
3
  "description": "The Telegram Bot Framework.",
4
- "version": "1.26.0",
4
+ "version": "1.27.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.10.0",
20
+ "@grammyjs/types": "3.11.0",
21
21
  "abort-controller": "^3.0.0",
22
22
  "debug": "^4.3.4",
23
23
  "node-fetch": "^2.7.0"