Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grammy

Package Overview
Dependencies
Maintainers
1
Versions
120
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.27.0 to 1.28.0

4

out/bot.d.ts

@@ -202,3 +202,3 @@ import { BotError, Composer, type Middleware, type ReactionMiddleware } from "./composer.js";

* If you're writing a library on top of grammY, check out the
* [documentation](https://grammy.dev/plugins/runner.html) of the runner
* [documentation](https://grammy.dev/plugins/runner) of the runner
* plugin for an example that uses this method.

@@ -239,3 +239,3 @@ *

* you worry about how much load your bot can handle, check out the grammY
* [documentation](https://grammy.dev/advanced/scaling.html) about scaling
* [documentation](https://grammy.dev/advanced/scaling) about scaling
* up.

@@ -242,0 +242,0 @@ *

@@ -211,3 +211,3 @@ "use strict";

* If you're writing a library on top of grammY, check out the
* [documentation](https://grammy.dev/plugins/runner.html) of the runner
* [documentation](https://grammy.dev/plugins/runner) of the runner
* plugin for an example that uses this method.

@@ -271,3 +271,3 @@ *

* you worry about how much load your bot can handle, check out the grammY
* [documentation](https://grammy.dev/advanced/scaling.html) about scaling
* [documentation](https://grammy.dev/advanced/scaling) about scaling
* up.

@@ -274,0 +274,0 @@ *

@@ -68,3 +68,3 @@ 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";

* more advanced things about middleware, check out the
* [documentation](https://grammy.dev/guide/middleware.html) on the website.
* [documentation](https://grammy.dev/guide/middleware) on the website.
*/

@@ -100,3 +100,3 @@ export type Middleware<C extends Context = Context> = MiddlewareFn<C> | MiddlewareObj<C>;

* middleware, check out the
* [documentation](https://grammy.dev/advanced/middleware.html) on the website.
* [documentation](https://grammy.dev/advanced/middleware) on the website.
*/

@@ -126,3 +126,3 @@ export declare class Composer<C extends Context> implements MiddlewareObj<C> {

* be further extended, and all changes will be regarded here. Confer the
* [documentation](https://grammy.dev/advanced/middleware.html) on the
* [documentation](https://grammy.dev/advanced/middleware) on the
* website if you want to know more about how the middleware system in

@@ -163,3 +163,3 @@ * grammY works, especially when it comes to chaining the method calls

* Check out the
* [documentation](https://grammy.dev/guide/filter-queries.html) on the
* [documentation](https://grammy.dev/guide/filter-queries) on the
* website to learn more about filter queries in grammY.

@@ -327,3 +327,3 @@ *

* ```
* [Remember](https://grammy.dev/guide/context.html#shortcuts) also that you
* [Remember](https://grammy.dev/guide/context#shortcuts) also that you
* can access the chat type via `ctx.chat.type`.

@@ -671,3 +671,3 @@ *

* Check out the
* [documentation](https://grammy.dev/guide/errors.html#error-boundaries) on
* [documentation](https://grammy.dev/guide/errors#error-boundaries) on
* the website to learn more about error boundaries.

@@ -674,0 +674,0 @@ *

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Composer = exports.run = exports.BotError = void 0;
exports.Composer = exports.BotError = void 0;
exports.run = run;
const context_js_1 = require("./context.js");

@@ -78,3 +79,2 @@ // === Middleware errors

}
exports.run = run;
// === Composer

@@ -92,3 +92,3 @@ /**

* middleware, check out the
* [documentation](https://grammy.dev/advanced/middleware.html) on the website.
* [documentation](https://grammy.dev/advanced/middleware) on the website.
*/

@@ -123,3 +123,3 @@ class Composer {

* be further extended, and all changes will be regarded here. Confer the
* [documentation](https://grammy.dev/advanced/middleware.html) on the
* [documentation](https://grammy.dev/advanced/middleware) on the
* website if you want to know more about how the middleware system in

@@ -164,3 +164,3 @@ * grammY works, especially when it comes to chaining the method calls

* Check out the
* [documentation](https://grammy.dev/guide/filter-queries.html) on the
* [documentation](https://grammy.dev/guide/filter-queries) on the
* website to learn more about filter queries in grammY.

@@ -336,3 +336,3 @@ *

* ```
* [Remember](https://grammy.dev/guide/context.html#shortcuts) also that you
* [Remember](https://grammy.dev/guide/context#shortcuts) also that you
* can access the chat type via `ctx.chat.type`.

@@ -684,3 +684,3 @@ *

* Check out the
* [documentation](https://grammy.dev/guide/errors.html#error-boundaries) on
* [documentation](https://grammy.dev/guide/errors#error-boundaries) on
* the website to learn more about error boundaries.

@@ -687,0 +687,0 @@ *

@@ -166,3 +166,3 @@ import { type InlineQueryResultArticle, type InlineQueryResultAudio, type InlineQueryResultCachedAudio, type InlineQueryResultCachedDocument, type InlineQueryResultCachedGif, type InlineQueryResultCachedMpeg4Gif, type InlineQueryResultCachedPhoto, type InlineQueryResultCachedSticker, type InlineQueryResultCachedVideo, type InlineQueryResultCachedVoice, type InlineQueryResultContact, type InlineQueryResultDocument, type InlineQueryResultGame, type InlineQueryResultGif, type InlineQueryResultLocation, type InlineQueryResultMpeg4Gif, type InlineQueryResultPhoto, type InlineQueryResultVenue, type InlineQueryResultVideo, type InlineQueryResultVoice, type InputContactMessageContent, type InputInvoiceMessageContent, type InputLocationMessageContent, type InputTextMessageContent, type InputVenueMessageContent, type LabeledPrice } from "../types.js";

game(id: string, game_short_name: string, options?: InlineQueryResultOptions<InlineQueryResultGame, "game_short_name">): {
reply_markup?: import("@grammyjs/types/markup.js").InlineKeyboardMarkup | undefined;
reply_markup?: import("@grammyjs/types/markup.js").InlineKeyboardMarkup;
type: string;

@@ -169,0 +169,0 @@ id: string;

@@ -40,3 +40,3 @@ import { type InlineKeyboardButton, type KeyboardButton, type KeyboardButtonPollType, type KeyboardButtonRequestChat, type KeyboardButtonRequestUsers, type LoginUrl, type SwitchInlineQueryChosenChat } from "../types.js";

* Be sure to check out the
* [documentation](https://grammy.dev/plugins/keyboard.html#custom-keyboards) on
* [documentation](https://grammy.dev/plugins/keyboard#custom-keyboards) on
* custom keyboards in grammY.

@@ -225,3 +225,3 @@ */

* Make the current keyboard persistent. See
* https://grammy.dev/plugins/keyboard.html#persistent-keyboards for more
* https://grammy.dev/plugins/keyboard#persistent-keyboards for more
* details.

@@ -238,3 +238,3 @@ *

* Make the current keyboard selective. See
* https://grammy.dev/plugins/keyboard.html#selectively-send-custom-keyboards
* https://grammy.dev/plugins/keyboard#selectively-send-custom-keyboards
* for more details.

@@ -251,3 +251,3 @@ *

* Make the current keyboard one-time. See
* https://grammy.dev/plugins/keyboard.html#one-time-custom-keyboards for
* https://grammy.dev/plugins/keyboard#one-time-custom-keyboards for
* more details.

@@ -264,3 +264,3 @@ *

* Make the current keyboard resized. See
* https://grammy.dev/plugins/keyboard.html#resize-custom-keyboard for more
* https://grammy.dev/plugins/keyboard#resize-custom-keyboard for more
* details.

@@ -277,3 +277,3 @@ *

* Set the current keyboard's input field placeholder. See
* https://grammy.dev/plugins/keyboard.html#input-field-placeholder for more
* https://grammy.dev/plugins/keyboard#input-field-placeholder for more
* details.

@@ -410,3 +410,3 @@ *

* Be sure to to check the
* [documentation](https://grammy.dev/plugins/keyboard.html#inline-keyboards) on
* [documentation](https://grammy.dev/plugins/keyboard#inline-keyboards) on
* inline keyboards in grammY.

@@ -413,0 +413,0 @@ */

@@ -40,3 +40,3 @@ "use strict";

* Be sure to check out the
* [documentation](https://grammy.dev/plugins/keyboard.html#custom-keyboards) on
* [documentation](https://grammy.dev/plugins/keyboard#custom-keyboards) on
* custom keyboards in grammY.

@@ -241,3 +241,3 @@ */

* Make the current keyboard persistent. See
* https://grammy.dev/plugins/keyboard.html#persistent-keyboards for more
* https://grammy.dev/plugins/keyboard#persistent-keyboards for more
* details.

@@ -257,3 +257,3 @@ *

* Make the current keyboard selective. See
* https://grammy.dev/plugins/keyboard.html#selectively-send-custom-keyboards
* https://grammy.dev/plugins/keyboard#selectively-send-custom-keyboards
* for more details.

@@ -273,3 +273,3 @@ *

* Make the current keyboard one-time. See
* https://grammy.dev/plugins/keyboard.html#one-time-custom-keyboards for
* https://grammy.dev/plugins/keyboard#one-time-custom-keyboards for
* more details.

@@ -289,3 +289,3 @@ *

* Make the current keyboard resized. See
* https://grammy.dev/plugins/keyboard.html#resize-custom-keyboard for more
* https://grammy.dev/plugins/keyboard#resize-custom-keyboard for more
* details.

@@ -305,3 +305,3 @@ *

* Set the current keyboard's input field placeholder. See
* https://grammy.dev/plugins/keyboard.html#input-field-placeholder for more
* https://grammy.dev/plugins/keyboard#input-field-placeholder for more
* details.

@@ -472,3 +472,3 @@ *

* Be sure to to check the
* [documentation](https://grammy.dev/plugins/keyboard.html#inline-keyboards) on
* [documentation](https://grammy.dev/plugins/keyboard#inline-keyboards) on
* inline keyboards in grammY.

@@ -475,0 +475,0 @@ */

@@ -11,5 +11,5 @@ import { type MiddlewareFn } from "../composer.js";

* out the
* [documentation](https://doc.deno.land/https://deno.land/x/grammy/mod.ts/~/session)
* [documentation](https://grammy.dev/ref/core/session)
* on session middleware to know more, and read the section about sessions on
* the [website](https://grammy.dev/plugins/session.html).
* the [website](https://grammy.dev/plugins/session).
*/

@@ -41,6 +41,6 @@ export interface SessionFlavor<S> {

* same context object, the cached value will be used. Check out the
* [documentation](https://doc.deno.land/https://deno.land/x/grammy/mod.ts/~/lazySession)
* [documentation](https://grammy.dev/ref/core/lazysession)
* on lazy session middleware to know more, and read the section about lazy
* sessions on the
* [website](https://grammy.dev/plugins/session.html#lazy-sessions).
* [website](https://grammy.dev/plugins/session#lazy-sessions).
*/

@@ -120,3 +120,3 @@ export interface LazySessionFlavor<S> {

* your chats and users. Check out the
* [documentation](https://grammy.dev/plugins/session.html#how-to-use-sessions)
* [documentation](https://grammy.dev/plugins/session#how-to-use-sessions)
* on the website about how to use session middleware to know how session

@@ -134,3 +134,3 @@ * keys are used.

* Consider using a [known storage
* adapter](https://grammy.dev/plugins/session.html#known-storage-adapters)
* adapter](https://grammy.dev/plugins/session#known-storage-adapters)
* instead of rolling your own implementation of this.

@@ -195,3 +195,3 @@ *

*
* Check out the [documentation](https://grammy.dev/plugins/session.html) on the
* Check out the [documentation](https://grammy.dev/plugins/session) on the
* website to know more about how sessions work in grammY.

@@ -229,3 +229,3 @@ *

* Check out the
* [documentation](https://grammy.dev/plugins/session.html#lazy-sessions) on the
* [documentation](https://grammy.dev/plugins/session#lazy-sessions) on the
* website to know more about how lazy sessions work in grammY.

@@ -323,3 +323,3 @@ *

session: S;
expires?: number | undefined;
expires?: number;
}>;

@@ -326,0 +326,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MemorySessionStorage = exports.enhanceStorage = exports.lazySession = exports.session = void 0;
exports.MemorySessionStorage = void 0;
exports.session = session;
exports.lazySession = lazySession;
exports.enhanceStorage = enhanceStorage;
const platform_node_js_1 = require("../platform.node.js");

@@ -48,3 +51,3 @@ const debug = (0, platform_node_js_1.debug)("grammy:session");

*
* Check out the [documentation](https://grammy.dev/plugins/session.html) on the
* Check out the [documentation](https://grammy.dev/plugins/session) on the
* website to know more about how sessions work in grammY.

@@ -59,3 +62,2 @@ *

}
exports.session = session;
function strictSingleSession(options) {

@@ -118,3 +120,3 @@ const { initial, storage, getSessionKey, custom } = fillDefaults(options);

* Check out the
* [documentation](https://grammy.dev/plugins/session.html#lazy-sessions) on the
* [documentation](https://grammy.dev/plugins/session#lazy-sessions) on the
* website to know more about how lazy sessions work in grammY.

@@ -139,3 +141,2 @@ *

}
exports.lazySession = lazySession;
/**

@@ -293,3 +294,2 @@ * Internal class that manages a single property on the session. Can be used

}
exports.enhanceStorage = enhanceStorage;
function compatStorage(storage) {

@@ -296,0 +296,0 @@ return {

@@ -48,3 +48,3 @@ import { type Bot } from "../bot.js";

* Confer the grammY
* [documentation](https://grammy.dev/guide/deployment-types.html) to read more
* [documentation](https://grammy.dev/guide/deployment-types) to read more
* about how to run your bot with webhooks.

@@ -51,0 +51,0 @@ *

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.webhookCallback = void 0;
exports.webhookCallback = webhookCallback;
const platform_node_js_1 = require("../platform.node.js");

@@ -48,3 +48,2 @@ const frameworks_js_1 = require("./frameworks.js");

}
exports.webhookCallback = webhookCallback;
function timeoutIfNecessary(task, onTimeout, timeout) {

@@ -55,2 +54,3 @@ if (timeout === Infinity)

const handle = setTimeout(() => {
debugErr(`Request timed out after ${timeout} ms`);
if (onTimeout === "throw") {

@@ -57,0 +57,0 @@ reject(new Error(`Request timed out after ${timeout} ms`));

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

/// <reference types="node-fetch" />
import { type ApiMethods as Telegram, type ApiResponse, type Opts } from "../types.js";

@@ -33,3 +32,3 @@ export type Methods<R extends RawApi> = string & keyof R;

* Confer the grammY
* [documentation](https://grammy.dev/advanced/transformers.html) to read more
* [documentation](https://grammy.dev/advanced/transformers) to read more
* about how to use transformers.

@@ -36,0 +35,0 @@ */

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createRawApi = void 0;
exports.createRawApi = createRawApi;
const platform_node_js_1 = require("../platform.node.js");

@@ -128,3 +128,2 @@ const error_js_1 = require("./error.js");

}
exports.createRawApi = createRawApi;
const defaultBuildUrl = (root, token, method, env) => {

@@ -131,0 +130,0 @@ const prefix = env === "test" ? "test/" : "";

@@ -42,3 +42,3 @@ import { type ApiError, type ResponseParameters } from "../types.js";

* If an [API transformer
* function](https://grammy.dev/advanced/transformers.html) throws an error,
* function](https://grammy.dev/advanced/transformers) throws an error,
* grammY will regard this as if the network request failed. The contained error

@@ -45,0 +45,0 @@ * will then be the error that was thrown by the transformer function.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toHttpError = exports.HttpError = exports.toGrammyError = exports.GrammyError = void 0;
exports.HttpError = exports.GrammyError = void 0;
exports.toGrammyError = toGrammyError;
exports.toHttpError = toHttpError;
const platform_node_js_1 = require("../platform.node.js");

@@ -47,3 +49,2 @@ const debug = (0, platform_node_js_1.debug)("grammy:warn");

}
exports.toGrammyError = toGrammyError;
/**

@@ -58,3 +59,3 @@ * This class represents errors that are thrown by grammY because an HTTP call

* If an [API transformer
* function](https://grammy.dev/advanced/transformers.html) throws an error,
* function](https://grammy.dev/advanced/transformers) throws an error,
* grammY will regard this as if the network request failed. The contained error

@@ -89,2 +90,1 @@ * will then be the error that was thrown by the transformer function.

}
exports.toHttpError = toHttpError;

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

/// <reference types="node" />
/**

@@ -3,0 +2,0 @@ * Determines for a given payload if it may be sent as JSON, or if it has to be

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createFormDataPayload = exports.createJsonPayload = exports.requiresFormDataUpload = void 0;
exports.requiresFormDataUpload = requiresFormDataUpload;
exports.createJsonPayload = createJsonPayload;
exports.createFormDataPayload = createFormDataPayload;
const platform_node_js_1 = require("../platform.node.js");

@@ -21,3 +23,2 @@ const types_js_1 = require("../types.js");

}
exports.requiresFormDataUpload = requiresFormDataUpload;
/**

@@ -50,3 +51,2 @@ * Calls `JSON.stringify` but removes `null` values from objects before

}
exports.createJsonPayload = createJsonPayload;
async function* protectItr(itr, onError) {

@@ -82,3 +82,2 @@ try {

}
exports.createFormDataPayload = createFormDataPayload;
// === Form data creation

@@ -85,0 +84,0 @@ function createBoundary() {

@@ -20,5 +20,5 @@ import { type Context } from "./context.js";

* Check out the
* [documentation](https://doc.deno.land/https://deno.land/x/grammy/mod.ts/~/Composer)
* [documentation](https://grammy.dev/ref/core/composer#on)
* of `bot.on` for examples. In addition, the
* [website](https://grammy.dev/guide/filter-queries.html) contains more
* [website](https://grammy.dev/guide/filter-queries) contains more
* information about how filter queries work in grammY.

@@ -775,3 +775,3 @@ *

* different kinds of filter queries: Level 1, Level 2, and Level 3. Check out
* the [website](https://grammy.dev/guide/filter-queries.html) to read about how
* the [website](https://grammy.dev/guide/filter-queries) to read about how
* filter queries work in grammY, and how to use them.

@@ -778,0 +778,0 @@ *

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.preprocess = exports.parse = exports.matchFilter = void 0;
exports.matchFilter = matchFilter;
exports.parse = parse;
exports.preprocess = preprocess;
const filterQueryCache = new Map();

@@ -22,5 +24,5 @@ // === Obtain O(1) filter function from query

* Check out the
* [documentation](https://doc.deno.land/https://deno.land/x/grammy/mod.ts/~/Composer)
* [documentation](https://grammy.dev/ref/core/composer#on)
* of `bot.on` for examples. In addition, the
* [website](https://grammy.dev/guide/filter-queries.html) contains more
* [website](https://grammy.dev/guide/filter-queries) contains more
* information about how filter queries work in grammY.

@@ -42,3 +44,2 @@ *

}
exports.matchFilter = matchFilter;
function parse(filter) {

@@ -49,3 +50,2 @@ return Array.isArray(filter)

}
exports.parse = parse;
function compile(parsed) {

@@ -104,3 +104,2 @@ const preprocessed = parsed.flatMap((q) => check(q, preprocess(q)));

}
exports.preprocess = preprocess;
function check(original, preprocessed) {

@@ -107,0 +106,0 @@ if (preprocessed.length === 0)

@@ -1,4 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { Agent as HttpAgent } from "http";

@@ -5,0 +2,0 @@ import { Agent as HttpsAgent } from "https";

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultAdapter = exports.baseFetchConfig = exports.itrToStream = exports.debug = void 0;
exports.defaultAdapter = exports.itrToStream = exports.debug = void 0;
exports.baseFetchConfig = baseFetchConfig;
// === Needed imports

@@ -41,4 +42,3 @@ const http_1 = require("http");

}
exports.baseFetchConfig = baseFetchConfig;
// === Default webhook adapter
exports.defaultAdapter = "express";

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

/// <reference types="node" />
import { type ApiMethods as ApiMethodsF, type InputMedia as InputMediaF, type InputMediaAnimation as InputMediaAnimationF, type InputMediaAudio as InputMediaAudioF, type InputMediaDocument as InputMediaDocumentF, type InputMediaPhoto as InputMediaPhotoF, type InputMediaVideo as InputMediaVideoF, type InputPaidMedia as InputPaidMediaF, type InputPaidMediaPhoto as InputPaidMediaPhotoF, type InputPaidMediaVideo as InputPaidMediaVideoF, type InputSticker as InputStickerF, type Opts as OptsF } from "@grammyjs/types";

@@ -17,3 +16,3 @@ import { type ReadStream } from "fs";

* An `InputFile` wraps a number of different sources for [sending
* files](https://grammy.dev/guide/files.html#uploading-your-own-file).
* files](https://grammy.dev/guide/files#uploading-your-own-files).
*

@@ -30,3 +29,3 @@ * It corresponds to the `InputFile` type in the [Telegram Bot API

* Check out the
* [documentation](https://grammy.dev/guide/files.html#uploading-your-own-file)
* [documentation](https://grammy.dev/guide/files#uploading-your-own-files)
* on sending files with `InputFile`.

@@ -33,0 +32,0 @@ */

@@ -28,3 +28,3 @@ "use strict";

* An `InputFile` wraps a number of different sources for [sending
* files](https://grammy.dev/guide/files.html#uploading-your-own-file).
* files](https://grammy.dev/guide/files#uploading-your-own-files).
*

@@ -31,0 +31,0 @@ * It corresponds to the `InputFile` type in the [Telegram Bot API

{
"name": "grammy",
"description": "The Telegram Bot Framework.",
"version": "1.27.0",
"version": "1.28.0",
"author": "KnorpelSenf",

@@ -20,3 +20,3 @@ "license": "MIT",

"dependencies": {
"@grammyjs/types": "3.11.0",
"@grammyjs/types": "3.12.0",
"abort-controller": "^3.0.0",

@@ -23,0 +23,0 @@ "debug": "^4.3.4",

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

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

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