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

@azteam/telegram-api

Package Overview
Dependencies
Maintainers
1
Versions
159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azteam/telegram-api - npm Package Compare versions

Comparing version 1.0.63 to 1.0.64

src/constant.js

6

package.json
{
"name": "@azteam/telegram-api",
"version": "1.0.63",
"version": "1.0.64",
"description": "",

@@ -17,6 +17,2 @@ "main": "src/index.js",

"license": "MIT",
"bugs": {
"url": "https://github.com/toda93/telegram-api/issues"
},
"homepage": "https://github.com/toda93/telegram-api#readme",
"dependencies": {

@@ -23,0 +19,0 @@ "@azteam/http-client": "1.0.75"

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

import TelegramAPI from './TelegramAPI';
export default from './TelegramAPI';
export * from './constant';
export {
TelegramAPI,
}
import HttpClient from '@azteam/http-client';
import { CALLBACK_TYPE } from './constant';
class TelegramAPI {

@@ -42,3 +44,3 @@ constructor(token) {

async sendReply(id, message, menu, isRemoveKeyBoard = true) {
async sendReply(id, message, menu) {

@@ -51,8 +53,36 @@ return this.client.post(this.endpoint + '/sendMessage', {

resize_keyboard: true,
remove_keyboard: isRemoveKeyBoard
})
});
}
static parseCallback(data) {
if (data.callback_query) {
const { from } = data.callback_query;
return {
callbackType: CALLBACK_TYPE.CALLBACK
userID: from.id
}
}
const { from, text, entities } = data.message;
if (entities) {
if (entity.type === 'bot_command') {
return {
callbackType: CALLBACK_TYPE.COMMAND
userID: from.id,
text: parseText
}
} else {
console.info(entity);
}
}
return {
callbackType: CALLBACK_TYPE.TEXT
userID: from.id,
text,
}
}
}
export default TelegramAPI;
export default TelegramAPI;
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