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

puregram

Package Overview
Dependencies
Maintainers
0
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puregram - npm Package Compare versions

Comparing version 2.26.2 to 2.26.3

4

lib/common/keyboards/inline-keyboard.d.ts

@@ -125,4 +125,8 @@ import * as Interfaces from '../../generated/telegram-interfaces';

toJSON(): Interfaces.TelegramInlineKeyboardMarkup;
/** Clones the keyboard (creates a new one with the same set of buttons) */
clone(): InlineKeyboard;
/** Deletes a button with the specified payload */
delete(payload: string): this;
toString(): string;
}
export {};

@@ -178,2 +178,16 @@ "use strict";

}
/** Clones the keyboard (creates a new one with the same set of buttons) */
clone() {
return InlineKeyboard_1.keyboard(this.buttons);
}
/** Deletes a button with the specified payload */
delete(payload) {
const rowIndex = this.buttons.findIndex(row => row.findIndex(button => button.callback_data === payload) !== -1);
const buttonIndex = this.buttons[rowIndex].findIndex(button => button.callback_data === payload);
this.buttons[rowIndex].splice(buttonIndex, 1);
if (this.buttons[rowIndex].length === 0) {
this.buttons.splice(rowIndex, 1);
}
return this;
}
toString() {

@@ -180,0 +194,0 @@ return JSON.stringify(this);

@@ -125,3 +125,7 @@ import * as Interfaces from '../../generated/telegram-interfaces';

toJSON(): Interfaces.TelegramReplyKeyboardMarkup;
/** Deletes a button with the specified payload */
delete(text: string): this;
/** Clones the keyboard (creates a new one with the same set of buttons) */
clone(): Keyboard;
toString(): string;
}

@@ -211,2 +211,16 @@ "use strict";

}
/** Deletes a button with the specified payload */
delete(text) {
const rowIndex = this.buttons.findIndex(row => row.findIndex(button => button.text === text) !== -1);
const buttonIndex = this.buttons[rowIndex].findIndex(button => button.text === text);
this.buttons[rowIndex].splice(buttonIndex, 1);
if (this.buttons[rowIndex].length === 0) {
this.buttons.splice(rowIndex, 1);
}
return this;
}
/** Clones the keyboard (creates a new one with the same set of buttons) */
clone() {
return Keyboard_1.keyboard(this.buttons);
}
toString() {

@@ -213,0 +227,0 @@ return JSON.stringify(this);

44

lib/common/structures/chat.d.ts

@@ -45,3 +45,3 @@ import { Message } from '../../common/structures/message';

*/
get activeUsernames(): string[] | undefined;
get activeUsernames(): any;
/**

@@ -54,3 +54,3 @@ * Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details.

*/
get accentColorId(): number | undefined;
get accentColorId(): any;
/**

@@ -61,3 +61,3 @@ * Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background.

*/
get backgroundCustomEmojiId(): string | undefined;
get backgroundCustomEmojiId(): any;
/**

@@ -68,3 +68,3 @@ * Identifier of the accent color for the chat's profile background. See profile accent colors for more details.

*/
get profileAccentColorId(): number | undefined;
get profileAccentColorId(): any;
/**

@@ -75,3 +75,3 @@ * Custom emoji identifier of the emoji chosen by the chat for its profile background.

*/
get profileBackgroundCustomEmojiId(): string | undefined;
get profileBackgroundCustomEmojiId(): any;
/**

@@ -82,3 +82,3 @@ * Custom emoji identifier of emoji status of the other party in a private chat.

*/
get emojiStatusCustomEmojiId(): string | undefined;
get emojiStatusCustomEmojiId(): any;
/**

@@ -89,3 +89,3 @@ * Expiration date of the emoji status of the other party in a private chat, if any.

*/
get emojiStatusExpirationDate(): number | undefined;
get emojiStatusExpirationDate(): any;
/**

@@ -96,3 +96,3 @@ * Bio of the other party in a private chat.

*/
get bio(): string | undefined;
get bio(): any;
/**

@@ -110,3 +110,3 @@ * `true`, if privacy settings of the other party in the private chat allows

*/
hasRestrictedVoiceAndVideoMessages(): true | undefined;
hasRestrictedVoiceAndVideoMessages(): any;
/**

@@ -136,3 +136,3 @@ * `true`, if users need to join the supergroup before they can send messages.

*/
get description(): string | undefined;
get description(): any;
/**

@@ -145,3 +145,3 @@ * Chat invite link, for groups, supergroups and channel chats.

*/
get inviteLink(): string | undefined;
get inviteLink(): any;
/**

@@ -165,3 +165,3 @@ * Pinned message, for groups, supergroups and channels.

*/
get slowModeDelay(): number | undefined;
get slowModeDelay(): any;
/**

@@ -172,3 +172,3 @@ * For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions.

*/
get unrestrictBoostCount(): number | undefined;
get unrestrictBoostCount(): any;
/**

@@ -179,3 +179,3 @@ * The time after which all messages sent to the chat will be automatically deleted; in seconds.

*/
get messageAutoDeleteTime(): number | undefined;
get messageAutoDeleteTime(): any;
/**

@@ -186,3 +186,3 @@ * `true`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.

*/
hasAggressiveAntiSpamEnabled(): true | undefined;
hasAggressiveAntiSpamEnabled(): any;
/**

@@ -193,3 +193,3 @@ * `true`, if non-administrators can only get the list of bots and administrators in the chat.

*/
hasHiddenMembers(): true | undefined;
hasHiddenMembers(): any;
/**

@@ -200,3 +200,3 @@ * `true`, if messages from the chat can't be forwarded to other chats.

*/
hasProtectedContent(): true | undefined;
hasProtectedContent(): any;
/**

@@ -207,3 +207,3 @@ * `true`, if new chat members will have access to old messages; available only to chat administrators.

*/
hasVisibleHistory(): true | undefined;
hasVisibleHistory(): any;
/**

@@ -214,3 +214,3 @@ * For supergroups, name of group sticker set.

*/
get stickerSetName(): string | undefined;
get stickerSetName(): any;
/**

@@ -221,3 +221,3 @@ * `true`, if the bot can change the group sticker set.

*/
canSetStickerSet(): true | undefined;
canSetStickerSet(): any;
/**

@@ -228,3 +228,3 @@ * For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.

*/
get customEmojiStickerSetName(): string | undefined;
get customEmojiStickerSetName(): any;
/**

@@ -241,4 +241,4 @@ * Unique identifier for the linked chat,

*/
get linkedChatId(): number | undefined;
get linkedChatId(): any;
toJSON(): Interfaces.TelegramChat;
}

@@ -17,5 +17,5 @@ import * as Interfaces from '../../generated/telegram-interfaces';

/** `true`, if the sticker set contains animated stickers */
isAnimated(): boolean;
isAnimated(): any;
/** `true`, if the sticker set contains video stickers */
isVideo(): boolean;
isVideo(): any;
/** List of all set stickers */

@@ -22,0 +22,0 @@ get stickers(): StickerAttachment[] | undefined;

@@ -11,4 +11,4 @@ import * as Interfaces from '../../generated/telegram-interfaces';

/** Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. */
get userIds(): number[];
get userIds(): any;
toJSON(): Interfaces.TelegramUsersShared;
}

@@ -22,2 +22,6 @@ import { Message } from '../common/structures';

get sharedChatId(): number;
/** Title of the chat, if the title was requested by the bot. */
get sharedTitle(): string | undefined;
/** Username of the chat, if the username was requested by the bot and available. */
get sharedUsername(): string | undefined;
}

@@ -24,0 +28,0 @@ interface ChatSharedContext extends Constructor<ChatSharedContext>, Message, TargetMixin, SendMixin, ChatActionMixin, NodeMixin, PinsMixin, CloneMixin<ChatSharedContext, ChatSharedContextOptions> {

@@ -29,2 +29,10 @@ "use strict";

}
/** Title of the chat, if the title was requested by the bot. */
get sharedTitle() {
return this.event.title;
}
/** Username of the chat, if the username was requested by the bot and available. */
get sharedUsername() {
return this.event.username;
}
}

@@ -35,7 +43,10 @@ exports.ChatSharedContext = ChatSharedContext;

serialize(context) {
return {
const payload = {
requestId: context.requestId,
sharedChatId: context.sharedChatId
sharedChatId: context.sharedChatId,
sharedTitle: context.sharedTitle,
sharedUsername: context.sharedUsername
};
return (0, helpers_1.filterPayload)(payload);
}
});

@@ -21,3 +21,3 @@ import { Message } from '../common/structures';

/** Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. */
get sharedUserIds(): number[];
get sharedUserIds(): any;
}

@@ -24,0 +24,0 @@ interface UsersSharedContext extends Constructor<UsersSharedContext>, Message, TargetMixin, SendMixin, ChatActionMixin, NodeMixin, PinsMixin, CloneMixin<UsersSharedContext, UsersSharedContextOptions> {

@@ -86,3 +86,3 @@ import * as api from './methods';

/**
* Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz [poll](https://core.telegram.org/bots/api/#poll) can be copied only if the value of the field *correct\_option\_id* is known to the bot. The method is analogous to the method [forwardMessage](https://core.telegram.org/bots/api/#forwardmessage), but the copied message doesn't have a link to the original message. Returns the [MessageId](https://core.telegram.org/bots/api/#messageid) of the sent message on success.
* Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz [poll](https://core.telegram.org/bots/api/#poll) can be copied only if the value of the field *correct\_option\_id* is known to the bot. The method is analogous to the method [forwardMessage](https://core.telegram.org/bots/api/#forwardmessage), but the copied message doesn't have a link to the original message. Returns the [MessageId](https://core.telegram.org/bots/api/#messageid) of the sent message on success.
*

@@ -95,3 +95,3 @@ * ---

/**
* Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz [poll](https://core.telegram.org/bots/api/#poll) can be copied only if the value of the field *correct\_option\_id* is known to the bot. The method is analogous to the method [forwardMessages](https://core.telegram.org/bots/api/#forwardmessages), but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of [MessageId](https://core.telegram.org/bots/api/#messageid) of the sent messages is returned.
* Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz [poll](https://core.telegram.org/bots/api/#poll) can be copied only if the value of the field *correct\_option\_id* is known to the bot. The method is analogous to the method [forwardMessages](https://core.telegram.org/bots/api/#forwardmessages), but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of [MessageId](https://core.telegram.org/bots/api/#messageid) of the sent messages is returned.
*

@@ -146,3 +146,3 @@ * ---

/**
* Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as [Audio](https://core.telegram.org/bots/api/#audio) or [Document](https://core.telegram.org/bots/api/#document)). On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
* Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as [Audio](https://core.telegram.org/bots/api/#audio) or [Document](https://core.telegram.org/bots/api/#document)). On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
*

@@ -163,2 +163,10 @@ * ---

/**
* Use this method to send paid media to channel chats. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned.
*
* ---
*
* [**Documentation**](https://core.telegram.org/bots/api/#sendpaidmedia)
*/
sendPaidMedia: api.sendPaidMedia;
/**
* Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of [Messages](https://core.telegram.org/bots/api/#message) that were sent is returned.

@@ -424,3 +432,3 @@ *

/**
* Use this method to get up to date information about the chat. Returns a [Chat](https://core.telegram.org/bots/api/#chat) object on success.
* Use this method to get up-to-date information about the chat. Returns a [ChatFullInfo](https://core.telegram.org/bots/api/#chatfullinfo) object on success.
*

@@ -595,2 +603,10 @@ * ---

/**
* Use this method to get information about the connection of the bot with a business account. Returns a [BusinessConnection](https://core.telegram.org/bots/api/#businessconnection) object on success.
*
* ---
*
* [**Documentation**](https://core.telegram.org/bots/api/#getbusinessconnection)
*/
getBusinessConnection: api.getBusinessConnection;
/**
* Use this method to change the list of the bot's commands. See [this manual](https://core.telegram.org/bots/features#commands) for more details about bot commands. Returns *True* on success.

@@ -700,3 +716,3 @@ *

/**
* Use this method to edit text and [game](https://core.telegram.org/bots/api/#games) messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned.
* Use this method to edit text and [game](https://core.telegram.org/bots/api/#games) messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
*

@@ -709,3 +725,3 @@ * ---

/**
* Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned.
* Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
*

@@ -718,3 +734,3 @@ * ---

/**
* Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file\_id or specify a URL. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned.
* Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file\_id or specify a URL. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
*

@@ -743,3 +759,3 @@ * ---

/**
* Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned.
* Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
*

@@ -809,3 +825,3 @@ * ---

/**
* Use this method to upload a file with a sticker for later use in the [createNewStickerSet](https://core.telegram.org/bots/api/#createnewstickerset) and [addStickerToSet](https://core.telegram.org/bots/api/#addstickertoset) methods (the file can be used multiple times). Returns the uploaded [File](https://core.telegram.org/bots/api/#file) on success.
* Use this method to upload a file with a sticker for later use in the [createNewStickerSet](https://core.telegram.org/bots/api/#createnewstickerset), [addStickerToSet](https://core.telegram.org/bots/api/#addstickertoset), or [replaceStickerInSet](https://core.telegram.org/bots/api/#replacestickerinset) methods (the file can be used multiple times). Returns the uploaded [File](https://core.telegram.org/bots/api/#file) on success.
*

@@ -826,3 +842,3 @@ * ---

/**
* Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns *True* on success.
* Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns *True* on success.
*

@@ -851,2 +867,10 @@ * ---

/**
* Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling [deleteStickerFromSet](https://core.telegram.org/bots/api/#deletestickerfromset), then [addStickerToSet](https://core.telegram.org/bots/api/#addstickertoset), then [setStickerPositionInSet](https://core.telegram.org/bots/api/#setstickerpositioninset). Returns *True* on success.
*
* ---
*
* [**Documentation**](https://core.telegram.org/bots/api/#replacestickerinset)
*/
replaceStickerInSet: api.replaceStickerInSet;
/**
* Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns *True* on success.

@@ -957,2 +981,18 @@ *

/**
* Returns the bot's Telegram Star transactions in chronological order. On success, returns a [StarTransactions](https://core.telegram.org/bots/api/#startransactions) object.
*
* ---
*
* [**Documentation**](https://core.telegram.org/bots/api/#getstartransactions)
*/
getStarTransactions: api.getStarTransactions;
/**
* Refunds a successful payment in [Telegram Stars](https://t.me/BotNews/90). Returns *True* on success.
*
* ---
*
* [**Documentation**](https://core.telegram.org/bots/api/#refundstarpayment)
*/
refundStarPayment: api.refundStarPayment;
/**
* Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns *True* on success.

@@ -959,0 +999,0 @@ *

@@ -6,4 +6,4 @@ "use strict";

/// This file was auto-generated using https://github.com/ark0f/tg-bot-api
/// Based on Bot API v7.1.0, 16.02.2024
/// Generation date: 13.03.2024 03:27:26 MSK
/// Based on Bot API v7.7.0, 07.07.2024
/// Generation date: 14.07.2024 01:56:44 MSK
Object.defineProperty(exports, "__esModule", { value: true });

@@ -6,4 +6,4 @@ "use strict";

/// This file was auto-generated using https://github.com/ark0f/tg-bot-api
/// Based on Bot API v7.1.0, 16.02.2024
/// Generation date: 13.03.2024 03:27:26 MSK
/// Based on Bot API v7.7.0, 07.07.2024
/// Generation date: 14.07.2024 01:56:44 MSK
Object.defineProperty(exports, "__esModule", { value: true });

@@ -6,4 +6,4 @@ "use strict";

/// This file was auto-generated using https://github.com/ark0f/tg-bot-api
/// Based on Bot API v7.1.0, 16.02.2024
/// Generation date: 13.03.2024 03:27:26 MSK
/// Based on Bot API v7.7.0, 07.07.2024
/// Generation date: 14.07.2024 01:56:44 MSK
Object.defineProperty(exports, "__esModule", { value: true });
{
"name": "puregram",
"version": "2.26.2",
"version": "2.26.3",
"description": "powerful and modern telegram bot api sdk for node.js and typescript 😁",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -55,2 +55,5 @@ <!-- inspired by prisma.io & telegraf docs -->

> **MEMORANDUM**
> Should the reader of this document experience difficulty in comprehending the informal style of presentation, said individual is directed to refer to the [LEGAL.md](LEGAL.md) file for further information.
---

@@ -57,0 +60,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