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

grammy

Package Overview
Dependencies
Maintainers
4
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.1.6 to 1.1.7

29

out/convenience/webhook.js

@@ -7,13 +7,7 @@ "use strict";

const standard = (req, res) => ({
update: req.body,
update: Promise.resolve(req.body),
end: () => res.end(),
respond: json => res.send(json),
});
const withCtx = ctx => ({
update: ctx.request.body,
end: () => {
ctx.body = '';
},
respond: json => (ctx.response.body = json),
});
// Integrations with popular frameworks
const frameworkAdapters = {

@@ -23,6 +17,17 @@ express: standard,

https: standard,
koa: withCtx,
oak: withCtx,
koa: ctx => ({
update: Promise.resolve(ctx.request.body),
end: () => (ctx.body = ''),
respond: json => (ctx.response.body = json),
}),
oak: ctx => ({
update: ctx.request.body({ type: 'json' }).value,
end: () => (ctx.response.status = 200),
respond: json => {
ctx.response.type = 'json';
ctx.response.body = json;
},
}),
fastify: (req, reply) => ({
update: req.body,
update: Promise.resolve(req.body),
respond: json => reply.send(json),

@@ -74,3 +79,3 @@ }),

}
await timeoutIfNecessary(bot.handleUpdate(update, webhookReplyEnvelope), typeof onTimeout === 'function'
await timeoutIfNecessary(bot.handleUpdate(await update, webhookReplyEnvelope), typeof onTimeout === 'function'
? () => onTimeout(...args)

@@ -77,0 +82,0 @@ : onTimeout, timeoutMilliseconds);

@@ -17,3 +17,3 @@ import { ApiError, ResponseParameters } from '../platform';

/** The payload that was passed when calling the method. */
readonly payload: object;
readonly payload: Record<string, unknown>;
/** Flag that this request was unsuccessful. Always `false`. */

@@ -31,3 +31,3 @@ readonly ok: false;

/** The payload that was passed when calling the method. */
payload: object);
payload: Record<string, unknown>);
}

@@ -34,0 +34,0 @@ /**

{
"name": "grammy",
"description": "grammY core package ported to Node.js",
"version": "1.1.6",
"version": "1.1.7",
"author": "KnorpelSenf",

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

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