New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

typescript-telegram-bot-api

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-telegram-bot-api - npm Package Compare versions

Comparing version 0.1.10 to 0.1.11

47

dist/index.js

@@ -11,2 +11,3 @@ "use strict";

const util_1 = require("util");
const stream_1 = require("stream");
const errors_1 = require("./errors");

@@ -35,20 +36,3 @@ const pooling_1 = require("./pooling");

return new Promise((resolve, reject) => {
const formData = new form_data_1.default();
if (options)
Object.keys(options).forEach((key) => {
if (options[key] !== undefined) {
if (typeof options[key] === 'boolean') {
formData.append(key, String(options[key]));
}
else if (options[key] instanceof Buffer) {
formData.append(key, options[key], {
filename: 'file',
contentType: 'application/octet-stream',
});
}
else {
formData.append(key, options[key]);
}
}
});
const formData = this.createFormData(options);
const request = https_1.default.request(url, {

@@ -81,2 +65,29 @@ method: 'POST',

}
createFormData(options) {
const formData = new form_data_1.default();
if (options) {
for (const [key, value] of Object.entries(options)) {
if (value !== undefined) {
if (typeof options[key] === 'boolean') {
formData.append(key, String(options[key]));
}
else if (options[key] instanceof Buffer) {
formData.append(key, options[key], {
filename: 'file',
contentType: 'application/octet-stream',
});
}
else if (typeof options[key] === 'object' &&
!Array.isArray(options[key]) &&
!(options[key] instanceof stream_1.Readable)) {
formData.append(key, JSON.stringify(options[key]));
}
else {
formData.append(key, options[key]);
}
}
}
}
return formData;
}
async callApi(method, options, abortController) {

@@ -83,0 +94,0 @@ const url = `${this.baseURL}/bot${this.botToken}${this.testEnvironment ? '/test' : ''}/${method}`;

@@ -9,5 +9,5 @@ import { InputFile, MessageEntity, ParseMode } from './';

caption_entities?: MessageEntity[];
duration: number;
duration?: number;
performer?: string;
title?: string;
};
{
"type": "commonjs",
"name": "typescript-telegram-bot-api",
"version": "0.1.10",
"version": "0.1.11",
"description": "Telegram Bot API wrapper for Node.js written in TypeScript",

@@ -6,0 +6,0 @@ "repository": "github:Borodin/typescript-telegram-bot-api",

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