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

telegram-bot-api-nodejs

Package Overview
Dependencies
Maintainers
0
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 1.0.36 to 1.0.38

currencies.json

19

index.d.ts

@@ -1,2 +0,1 @@

export { formatPrice } from "./currencies.js";
export type ChatType = "private" | "group" | "supergroup" | "channel";

@@ -802,1 +801,19 @@ export type ChatAction = "typing" | "upload_photo" | "record_video" | "upload_video" | "record_audio" | "upload_audio" | "upload_document" | "find_location" | "record_video_note" | "upload_video_note";

export declare function resolveChatName(chat: any): string;
export declare namespace currencies {
interface Currency {
code: string;
title: string;
symbol: string;
native: string;
thousands_sep: string;
decimal_sep: string;
symbol_left: boolean;
space_between: boolean;
drop_zeros: boolean;
exp: number;
min_amount: string | number;
max_amount: string | number;
}
function formatPrice(amount: number, code: string): string;
}
export {};

@@ -1,2 +0,2 @@

export { formatPrice } from "./currencies.js";
import { readFileSync } from "fs";
/**

@@ -609,1 +609,43 @@ * Methods

}
export var currencies;
(function (currencies_1) {
const __dirname = import.meta.dirname;
let currencies = null;
function formatPrice(amount, code) {
if (!currencies) {
currencies = loadCurrencies();
}
const currency = currencies[code];
let value = "";
if (currency) {
if (currency.symbol_left && currency.native) {
value += currency.native;
if (currency.space_between) {
value += " ";
}
}
if (currency.exp > 0) {
value += amount / (10 ** currency.exp);
}
else {
value += `${amount}`;
}
if (!currency.symbol_left && currency.native) {
if (currency.space_between) {
value += " ";
}
value += currency.native;
}
}
else {
value = `${code} ${amount / 2}`;
}
return value;
}
currencies_1.formatPrice = formatPrice;
function loadCurrencies() {
return JSON.parse(readFileSync(`${__dirname}/currencies.json`, {
encoding: "utf8"
}));
}
})(currencies || (currencies = {}));

5

package.json
{
"name": "telegram-bot-api-nodejs",
"version": "1.0.36",
"version": "1.0.38",
"description": "Telegram Bot API client for nodejs",

@@ -13,3 +13,4 @@ "type": "module",

"index.js",
"index.d.ts"
"index.d.ts",
"currencies.json"
],

@@ -16,0 +17,0 @@ "scripts": {

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