grammy 1.26.0 → 1.26.1

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/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/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.26.1",
5
5
  "author": "KnorpelSenf",
6
6
  "license": "MIT",
7
7
  "engines": {