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.26 to 0.1.27

3

dist/types/InputFile.d.ts
import { ReadStream } from 'fs';
export type InputFile = ReadStream | Buffer | File;
import { FileOptions } from '../index';
export type InputFile = ReadStream | Buffer | File | FileOptions;
{
"type": "commonjs",
"name": "typescript-telegram-bot-api",
"version": "0.1.26",
"version": "0.1.27",
"description": "Telegram Bot API wrapper for Node.js written in TypeScript",

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

@@ -49,5 +49,7 @@ # 📦 typescript-telegram-bot-api

For sending files, you can use not only ```'file_id'``` or ```'url'```, but also ```stream.Readable``` or ```Buffer```.
To send files with additional parameters, such as a filename or specific contentType, use the ```FileOptions``` wrapper class.
```typescript
import {createReadStream} from 'fs';
import {readFile} from 'fs/promises';
import { TelegramBot, FileOptions } from 'typescript-telegram-bot-api';
import { createReadStream } from 'fs';
import { readFile } from 'fs/promises';

@@ -85,2 +87,15 @@

// or
await bot.sendPhoto({
chat_id: chat_id,
photo: new FileOptions(
await readFile('photo.jpg'), {
filename: 'custom_file_name.jpg',
contentType: 'image/jpeg',
}
),
caption: 'FileOptions',
});
// or in browser

@@ -90,3 +105,3 @@

chat_id: chat_id,
photo: input.files[0],
photo: input.files[0], // or new File(…)
caption: 'file',

@@ -93,0 +108,0 @@ });

Sorry, the diff of this file is too big to display

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