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

telegram-webhook-js

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

telegram-webhook-js - npm Package Compare versions

Comparing version 1.0.5 to 1.0.51

33

main.js

@@ -220,3 +220,3 @@ // telegram-bot.js

headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ callback_query_id: callbackQuery.id}),
body: JSON.stringify({ callback_query_id: callbackQuery.id }),
});

@@ -261,10 +261,10 @@ }

const fileId = photoArray[photoArray.length - 1].file_id;
// Get file path
const fileInfo = await this.getFile(fileId);
const filePath = fileInfo.file_path;
// Construct the download URL
const fileUrl = `https://api.telegram.org/file/bot${this.token}/${filePath}`;
return fileUrl; // Return the URL to download the image

@@ -276,3 +276,3 @@ } else {

}
async getFile(fileId) {

@@ -287,3 +287,24 @@ try {

}
async getFullNameById(userId) {
try {
// Make a request to get chat information
const response = await fetch(`${this.apiUrl}getChat?chat_id=${userId}`);
const data = await response.json();
// Check if the data contains user information
if (data.ok && data.result) {
const user = data.result;
// Construct and return the full name (first + last name)
const fullName = `${user.first_name} ${user.last_name || ''}`.trim();
return fullName;
} else {
console.error('Error: Unable to fetch user details.');
return null;
}
} catch (error) {
console.error('Error fetching user info:', error);
return null;
}
}
}

@@ -290,0 +311,0 @@

2

package.json
{
"name": "telegram-webhook-js",
"version": "1.0.5",
"version": "1.0.51",
"main": "main.js",

@@ -5,0 +5,0 @@ "type": "commonjs",

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