Socket
Socket
Sign inDemoInstall

nestgram

Package Overview
Dependencies
19
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.8.3 to 1.8.4

dist/classes/Marks/InviteLink.d.ts

23

dist/classes/Api.d.ts

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

import { Audio, ContentTypes, Document, IAnswerCallbackQueryOptions, ICopyMessageOptions, IDeleteWebhookConfig, IFile, IForwardMessageOptions, IMessage, IMessageId, InputSupportedMedia, ISendAnimationOptions, ISendAudioOptions, ISendDocumentOptions, ISendLocationOptions, ISendMediaGroupOptions, ISendPhotoOptions, ISendVideoNoteOptions, ISendVideoOptions, ISendVoiceOptions, IUser, IWebhookConfig, Keyboard, MessageCreator, Photo, Video, Voice, IStopMessageLiveLocationOptions, ISendVenueOptions, ISendContactOptions, ISendPollOptions, DiceEmojis, ISendDiceOptions, ChatActions, IUserProfilePhotos, IWebhookInfo, IChatPermissions, IPromoteChatPermissions, ICreateChatInviteLinkOptions, IChatInviteLink, IChat, ChatMember, IBotCommand, BotCommandScope, IChatAdministratorRights, IEditTextOptions, EditContentTypes, IEditCaptionOptions, SendOptions, IEditKeyboardOptions, IStopPollOptions, IPoll } from '..';
import { Audio, ContentTypes, Document, IAnswerCallbackQueryOptions, ICopyMessageOptions, IDeleteWebhookConfig, IFile, IForwardMessageOptions, IMessage, IMessageId, InputSupportedMedia, ISendAnimationOptions, ISendAudioOptions, ISendDocumentOptions, ISendLocationOptions, ISendMediaGroupOptions, ISendPhotoOptions, ISendVideoNoteOptions, ISendVideoOptions, ISendVoiceOptions, IUser, IWebhookConfig, Keyboard, MessageCreator, Photo, Video, Voice, IStopMessageLiveLocationOptions, ISendVenueOptions, ISendContactOptions, ISendPollOptions, DiceEmojis, ISendDiceOptions, ChatActions, IUserProfilePhotos, IWebhookInfo, IChatPermissions, IPromoteChatPermissions, ICreateChatInviteLinkOptions, IChatInviteLink, IChat, ChatMember, IBotCommand, BotCommandScope, IChatAdministratorRights, IEditTextOptions, EditContentTypes, IEditCaptionOptions, SendOptions, IEditKeyboardOptions, IStopPollOptions, IPoll, IEditLiveLocationOptions, IEditInviteLinkOptions } from '..';
import { Animation, Media, VideoNote } from './Media';

@@ -184,3 +184,3 @@ import { BotMenuButton } from '../types/menu-button.types';

* */
edit(chatId: number | string | null, msgId: number | null, content: EditContentTypes, keyboard?: Keyboard | null, moreOptions?: IEditTextOptions): Promise<IMessage | IPoll>;
edit(chatId: number | string | null, msgId: number | null, content: EditContentTypes, keyboard?: Keyboard | null, moreOptions?: IEditTextOptions): Promise<IMessage | IChatInviteLink>;
/**

@@ -216,2 +216,21 @@ * Edit a message caption

/**
* Edit chat live location
* @param chatId Chat id in which location you want to edit is located
* @param msgId Message id you want to edit live location
* @param latitude Location latitude
* @param longitude Location longitude
* @param keyboard Optional. Keyboard you want to add
* @param moreOptions Optional. More options. {@link IEditLiveLocationOptions}
* @see https://core.telegram.org/bots/api#editchatlivelocation
* */
editLiveLocation(chatId: number | string, msgId: number, latitude: number, longitude: number, keyboard?: Keyboard, moreOptions?: IEditLiveLocationOptions): Promise<IMessage>;
/**
* New chat invite link wrapper
* @param chatId Chat id in which you want to edit invite link
* @param inviteLink Invite link you want to edit
* @param options Options you want to edit. {@link IEditInviteLinkOptions}
* @see https://core.telegram.org/bots/api#editchatinvitelink
* */
editInviteLink(chatId: number | string | null, inviteLink: string, options: IEditInviteLinkOptions): Promise<IChatInviteLink>;
/**
* Delete a message

@@ -218,0 +237,0 @@ * @param chatId Chat ID in which message you want to delete is located

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

const MarkCreator_1 = require("./Marks/MarkCreator");
const InviteLink_1 = require("./Marks/InviteLink");
class Api {

@@ -203,2 +204,4 @@ constructor(token) {

moreOptions.reply_markup = keyboard.buildMarkup();
if (photo.options)
moreOptions = { ...moreOptions, ...photo.options };
return Api.saveMediaFileId(photo.media, 'photo', await this.callApi('sendPhoto', this.buildFormData('photo', photo, {

@@ -221,2 +224,4 @@ chat_id: chatId,

moreOptions.reply_markup = keyboard.buildMarkup();
if (video.options)
moreOptions = { ...moreOptions, ...video.options };
return Api.saveMediaFileId(video.media, 'video', await this.callApi('sendVideo', this.buildFormData('video', video, {

@@ -241,2 +246,4 @@ chat_id: chatId,

moreOptions.reply_markup = keyboard.buildMarkup();
if (videoNote.options)
moreOptions = { ...moreOptions, ...videoNote.options };
return Api.saveMediaFileId(videoNote.media, 'video_note', await this.callApi('sendVideoNote', this.buildFormData('video_note', videoNote, {

@@ -260,2 +267,4 @@ chat_id: chatId,

moreOptions.reply_markup = keyboard.buildMarkup();
if (audio.options)
moreOptions = { ...moreOptions, ...audio.options };
return Api.saveMediaFileId(audio.media, 'audio', await this.callApi('sendAudio', this.buildFormData('audio', audio, {

@@ -279,2 +288,4 @@ chat_id: chatId,

moreOptions.reply_markup = keyboard.buildMarkup();
if (voice.options)
moreOptions = { ...moreOptions, ...voice.options };
return Api.saveMediaFileId(voice.media, 'voice', await this.callApi('sendVoice', this.buildFormData('voice', voice, {

@@ -297,2 +308,4 @@ chat_id: chatId,

moreOptions.reply_markup = keyboard.buildMarkup();
if (document.options)
moreOptions = { ...moreOptions, ...document.options };
return Api.saveMediaFileId(document.media, 'document', await this.callApi('sendDocument', this.buildFormData('document', document, {

@@ -316,2 +329,4 @@ chat_id: chatId,

moreOptions.reply_markup = keyboard.buildMarkup();
if (animation.options)
moreOptions = { ...moreOptions, ...animation.options };
return Api.saveMediaFileId(animation.media, 'animation', await this.callApi('sendAnimation', this.buildFormData('animation', animation, {

@@ -485,2 +500,8 @@ chat_id: chatId,

}
else if (content instanceof __1.LiveLocation) {
return this.editLiveLocation(chatId, msgId, content.latitude, content.longitude, content.keyboard, content.moreOptions);
}
else if (content instanceof InviteLink_1.InviteLink) {
return this.editInviteLink(chatId, content.inviteLink, content.options);
}
else

@@ -570,2 +591,37 @@ return;

/**
* Edit chat live location
* @param chatId Chat id in which location you want to edit is located
* @param msgId Message id you want to edit live location
* @param latitude Location latitude
* @param longitude Location longitude
* @param keyboard Optional. Keyboard you want to add
* @param moreOptions Optional. More options. {@link IEditLiveLocationOptions}
* @see https://core.telegram.org/bots/api#editchatlivelocation
* */
editLiveLocation(chatId, msgId, latitude, longitude, keyboard, moreOptions = {}) {
if (keyboard)
moreOptions.reply_markup = keyboard.buildMarkup();
return this.callApi('editMessageLiveLocation', {
chat_id: chatId,
message_id: msgId,
latitude,
longitude,
...(moreOptions || {}),
});
}
/**
* New chat invite link wrapper
* @param chatId Chat id in which you want to edit invite link
* @param inviteLink Invite link you want to edit
* @param options Options you want to edit. {@link IEditInviteLinkOptions}
* @see https://core.telegram.org/bots/api#editchatinvitelink
* */
editInviteLink(chatId, inviteLink, options) {
return this.callApi('editChatInviteLink', {
chat_id: chatId,
invite_link: inviteLink,
...(options || {}),
});
}
/**
* Delete a message

@@ -572,0 +628,0 @@ * @param chatId Chat ID in which message you want to delete is located

2

dist/classes/Context/Answer.d.ts

@@ -26,3 +26,3 @@ import { Keyboard, ChatActions, ContentTypes, IAnswerCallbackQueryOptions, IForwardMessageOptions, ICopyMessageOptions, IStopMessageLiveLocationOptions, IMessage, IUpdate, IFile, IUserProfilePhotos, IMessageId, IChatPermissions, IPromoteChatPermissions, ICreateChatInviteLinkOptions, IChatInviteLink, Photo, IChat, ChatMember, IBotCommand, BotCommandScope, IChatAdministratorRights, IEditTextOptions, EditContentTypes, SendOptions, IStopPollOptions, IPoll } from '../..';

* */
edit(content: EditContentTypes, keyboard?: Keyboard, moreOptions?: IEditTextOptions, msgId?: number): Promise<IMessage | IPoll>;
edit(content: EditContentTypes, keyboard?: Keyboard, moreOptions?: IEditTextOptions, msgId?: number): Promise<IMessage | IChatInviteLink>;
/**

@@ -29,0 +29,0 @@ * Delete a message

export * from './Caption';
export * from './LiveLocation';
export * from './InviteLink';

@@ -18,2 +18,4 @@ "use strict";

__exportStar(require("./Caption"), exports);
__exportStar(require("./LiveLocation"), exports);
__exportStar(require("./InviteLink"), exports);
//# sourceMappingURL=index.js.map

@@ -6,3 +6,3 @@ import { MediaFileTypes, MediaPassTypes, MediaSendTypes } from '../../types';

media: string;
readonly options?: any;
options: any;
readonly useCache: boolean;

@@ -24,2 +24,7 @@ type: MediaFileTypes | MediaSendTypes;

setThumb(thumb: Thumb): this;
/**
* Set caption for media
* @param caption Caption you want to set
* */
setCaption(caption: string): this;
}

@@ -12,3 +12,3 @@ "use strict";

* */
constructor(passType, media, options, useCache = true) {
constructor(passType, media, options = {}, useCache = true) {
this.passType = passType;

@@ -27,4 +27,14 @@ this.media = media;

}
/**
* Set caption for media
* @param caption Caption you want to set
* */
setCaption(caption) {
if (!this.options)
this.options = {};
this.options.caption = caption;
return this;
}
}
exports.Media = Media;
//# sourceMappingURL=Media.js.map

@@ -27,2 +27,7 @@ import { ConfigTypes, IRunConfig, IHandler, IUser } from '.';

/**
* Use an API class with a different token
* @param token Bot token you want to get api class
* */
to(token: string): Api;
/**
* Starts bot using Long Polling or Webhooks

@@ -29,0 +34,0 @@ * @return bot username

@@ -110,2 +110,9 @@ "use strict";

/**
* Use an API class with a different token
* @param token Bot token you want to get api class
* */
to(token) {
return new classes_1.Api(token);
}
/**
* Starts bot using Long Polling or Webhooks

@@ -112,0 +119,0 @@ * @return bot username

@@ -399,2 +399,25 @@ import { IMessageEntity, IPhotoSize } from './update.types';

}
export interface IEditLiveLocationFetchOptions extends IEditLiveLocationOptions {
chat_id?: number | string;
message_id?: number;
latitude: number;
longitude: number;
}
export interface IEditLiveLocationOptions {
inline_message_id?: string;
horizontal_accuracy?: number;
heading?: number;
proximity_alert_radius?: number;
reply_markup?: IInlineKeyboard;
}
export interface IEditInviteLinkFetchOptions extends IEditInviteLinkOptions {
chat_id: number | string;
invite_link: string;
}
export interface IEditInviteLinkOptions {
name?: string;
expire_date?: number;
member_limit?: number;
creates_join_request?: boolean;
}
export interface ICreateChatInviteLinkFetchOptions extends ICreateChatInviteLinkOptions, IExportChatInviteLinkFetchOptions {

@@ -401,0 +424,0 @@ }

{
"name": "nestgram",
"description": "Framework for working with Telegram Bot API on TypeScript like Nest.js",
"version": "1.8.3",
"version": "1.8.4",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "types": "dist/index.d.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc