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
1
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.13 to 1.0.14

29

index.d.ts

@@ -555,3 +555,18 @@ export type ChatType = "private" | "group" | "supergroup" | "channel";

export declare function sendAnimation(token: string, payload: SendAnimationOptions, signal: AbortSignal): Promise<Message>;
export declare function sendDocument(token: string, payload: SendDocumentOptions, signal: AbortSignal): Promise<Message>;
/**
* @example
*
* const body = new FormData()
*
* body.append("chat_id", payload.chat_id)
* body.append("caption", payload.caption)
* body.append("document", payload.document, payload.documentName)
*
* if (payload.parse_mode) {
* body.append("parse_mode", payload.parse_mode)
* }
*
* sendDocument("token", payload)
*/
export declare function sendDocument(token: string, payload: SendDocumentOptions | FormData, signal: AbortSignal): Promise<Message>;
export declare function sendMediaGroup(token: string, payload: SendMediaGroupOptions, signal: AbortSignal): Promise<Message[]>;

@@ -672,8 +687,8 @@ export declare function setMessageReaction(token: string, payload: {

export declare const SUPPORTED_REACTION_EMOJI: string[];
export declare function isUnauthorizedError(err: unknown): err is Error;
export declare function isBotBlockedByUserError(err: unknown): err is Error;
export declare function isChatNotFoundError(err: unknown): err is Error;
export declare function isUserDeactivatedError(err: unknown): err is Error;
export declare function isBotKickedFromSupergroupError(err: unknown): err is Error;
export declare function isNotEnoughRightsError(err: unknown): err is Error;
export declare function isUnauthorizedError(err: unknown): boolean;
export declare function isBotBlockedByUserError(err: unknown): boolean;
export declare function isChatNotFoundError(err: unknown): boolean;
export declare function isUserDeactivatedError(err: unknown): boolean;
export declare function isBotKickedFromSupergroupError(err: unknown): boolean;
export declare function isNotEnoughRightsError(err: unknown): boolean;
export {};

@@ -73,7 +73,31 @@ /**

}
/**
* @example
*
* const body = new FormData()
*
* body.append("chat_id", payload.chat_id)
* body.append("caption", payload.caption)
* body.append("document", payload.document, payload.documentName)
*
* if (payload.parse_mode) {
* body.append("parse_mode", payload.parse_mode)
* }
*
* sendDocument("token", payload)
*/
export function sendDocument(token, payload, signal) {
let h = headers;
let b = undefined;
if (payload instanceof FormData) {
h = undefined;
b = payload;
}
else {
b = JSON.stringify(payload);
}
return fetch(`https://api.telegram.org/bot${token}/sendDocument`, {
method: "POST",
body: JSON.stringify(payload),
headers,
body: b,
headers: h,
signal

@@ -80,0 +104,0 @@ }).then((parseResponse));

{
"name": "telegram-bot-api-nodejs",
"version": "1.0.13",
"version": "1.0.14",
"description": "Telegram Bot API client for nodejs",

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

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