Socket
Socket
Sign inDemoInstall

grammy

Package Overview
Dependencies
Maintainers
0
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grammy - npm Package Compare versions

Comparing version 1.25.1 to 1.25.2

60

out/composer.d.ts

@@ -1,2 +0,2 @@

import { type CallbackQueryContext, type ChatTypeContext, type ChosenInlineResultContext, type CommandContext, Context, type GameQueryContext, type HearsContext, type InlineQueryContext, type MaybeArray, type ReactionContext, type StringWithSuggestions } from "./context.js";
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";
import { type Filter, type FilterQuery } from "./filter.js";

@@ -432,2 +432,42 @@ import { type Chat, type ReactionType, type ReactionTypeEmoji } from "./types.js";

/**
* Registers middleware for pre-checkout queries. Telegram sends a pre-checkout
* query to your bot whenever a user has confirmed their payment and shipping
* details. You bot will then receive all information about the order and
* has to respond within 10 seconds with a confirmation of whether everything
* is alright (goods are available, etc.) and the bot is ready to proceed
* with the order. Check out https://core.telegram.org/bots/api#precheckoutquery
* to read more about pre-checkout queries.
*
* ```ts
* bot.preCheckoutQuery('invoice_payload', async ctx => {
* // Answer the pre-checkout query, confer https://core.telegram.org/bots/api#answerprecheckoutquery
* await ctx.answerPreCheckoutQuery( ... )
* })
* ```
*
* @param trigger The string to look for in the invoice payload
* @param middleware The middleware to register
*/
preCheckoutQuery(trigger: MaybeArray<string | RegExp>, ...middleware: Array<PreCheckoutQueryMiddleware<C>>): Composer<PreCheckoutQueryContext<C>>;
/**
* Registers middleware for shipping queries. If you sent an invoice requesting
* a shipping address and the parameter _is_flexible_ was specified, Telegram
* will send a shipping query to your bot whenever a user has confirmed their
* shipping details. You bot will then receive the shipping information and
* can respond with a confirmation of whether delivery to the specified address
* is possible. Check out https://core.telegram.org/bots/api#shippingquery to
* read more about shipping queries.
*
* ```ts
* bot.shippingQuery('invoice_payload', async ctx => {
* // Answer the shipping query, confer https://core.telegram.org/bots/api#answershippingquery
* await ctx.answerShippingQuery( ... )
* })
* ```
*
* @param trigger The string to look for in the invoice payload
* @param middleware The middleware to register
*/
shippingQuery(trigger: MaybeArray<string | RegExp>, ...middleware: Array<ShippingQueryMiddleware<C>>): Composer<ShippingQueryContext<C>>;
/**
* > This is an advanced method of grammY.

@@ -697,2 +737,20 @@ *

/**
* Type of the middleware that can be passed to `bot.preCheckoutQuery`.
*
* This helper type can be used to annotate middleware functions that are
* defined in one place, so that they have the correct type when passed to
* `bot.preCheckoutQuery` in a different place. For instance, this allows for more
* modular code where handlers are defined in separate files.
*/
export type PreCheckoutQueryMiddleware<C extends Context> = Middleware<PreCheckoutQueryContext<C>>;
/**
* Type of the middleware that can be passed to `bot.shippingQuery`.
*
* This helper type can be used to annotate middleware functions that are
* defined in one place, so that they have the correct type when passed to
* `bot.shippingQuery` in a different place. For instance, this allows for more
* modular code where handlers are defined in separate files.
*/
export type ShippingQueryMiddleware<C extends Context> = Middleware<ShippingQueryContext<C>>;
/**
* Type of the middleware that can be passed to `bot.chatType`.

@@ -699,0 +757,0 @@ *

@@ -450,2 +450,46 @@ "use strict";

}
/**
* Registers middleware for pre-checkout queries. Telegram sends a pre-checkout
* query to your bot whenever a user has confirmed their payment and shipping
* details. You bot will then receive all information about the order and
* has to respond within 10 seconds with a confirmation of whether everything
* is alright (goods are available, etc.) and the bot is ready to proceed
* with the order. Check out https://core.telegram.org/bots/api#precheckoutquery
* to read more about pre-checkout queries.
*
* ```ts
* bot.preCheckoutQuery('invoice_payload', async ctx => {
* // Answer the pre-checkout query, confer https://core.telegram.org/bots/api#answerprecheckoutquery
* await ctx.answerPreCheckoutQuery( ... )
* })
* ```
*
* @param trigger The string to look for in the invoice payload
* @param middleware The middleware to register
*/
preCheckoutQuery(trigger, ...middleware) {
return this.filter(context_js_1.Context.has.preCheckoutQuery(trigger), ...middleware);
}
/**
* Registers middleware for shipping queries. If you sent an invoice requesting
* a shipping address and the parameter _is_flexible_ was specified, Telegram
* will send a shipping query to your bot whenever a user has confirmed their
* shipping details. You bot will then receive the shipping information and
* can respond with a confirmation of whether delivery to the specified address
* is possible. Check out https://core.telegram.org/bots/api#shippingquery to
* read more about shipping queries.
*
* ```ts
* bot.shippingQuery('invoice_payload', async ctx => {
* // Answer the shipping query, confer https://core.telegram.org/bots/api#answershippingquery
* await ctx.answerShippingQuery( ... )
* })
* ```
*
* @param trigger The string to look for in the invoice payload
* @param middleware The middleware to register
*/
shippingQuery(trigger, ...middleware) {
return this.filter(context_js_1.Context.has.shippingQuery(trigger), ...middleware);
}
filter(predicate, ...middleware) {

@@ -452,0 +496,0 @@ const composer = new Composer(...middleware);

2

package.json
{
"name": "grammy",
"description": "The Telegram Bot Framework.",
"version": "1.25.1",
"version": "1.25.2",
"author": "KnorpelSenf",

@@ -6,0 +6,0 @@ "license": "MIT",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc