Socket
Socket
Sign inDemoInstall

puregram

Package Overview
Dependencies
Maintainers
1
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puregram - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8-rc.1

2

package.json
{
"name": "puregram",
"version": "1.1.7",
"version": "1.1.8-rc.1",
"main": "src/index.js",

@@ -5,0 +5,0 @@ "repository": {

@@ -35,3 +35,3 @@ import Params from '../../typings/params';

*/
public from: User;
public from: Interfaces.IUser;

@@ -132,2 +132,7 @@ /**

/**
* [Deep-linking](https://core.telegram.org/bots#deep-linking) payload
*/
public startPayload?: string | number | object;
/**
* For text messages, special entities like usernames,

@@ -134,0 +139,0 @@ * URLs, bot commands, etc. that appear in the text

@@ -30,2 +30,12 @@ let { inspect } = require('util');

function isParseable(source) {
try {
JSON.parse(source);
return true;
} catch (e) {
return false;
}
}
class MessageContext extends Context {

@@ -136,2 +146,17 @@ constructor(telegram, update) {

get startPayload() {
if (!this.text.startsWith('/start')) return null;
if (this.text === '/start') return null;
let payload = this.text.split(' ')[1];
if (!Number.isNaN(+payload)) {
payload = Number.parseInt(payload);
} else if (isParseable(payload)) {
payload = JSON.parse(payload);
}
return payload
}
get entities() {

@@ -138,0 +163,0 @@ let { entities } = this.update;

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