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

@apidog/multibot-sdk-ts

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apidog/multibot-sdk-ts - npm Package Compare versions

Comparing version 0.0.8-0 to 0.0.8-1

317

dist/telegram/index.d.ts

@@ -0,5 +1,10 @@

/// <reference types="node" />
import AbstractBot, { IBotPolling } from '../abstract-bot';
import { Config, Request, User, Message, Update, CallbackQuery, Chat, InlineQuery, ChosenInlineResult, Location } from './types';
import { User, Message, Update, CallbackQuery, Chat, InlineQuery, ChosenInlineResult, Location, WebhookInfo, ParseMode, ChatAction, UserProfilePhotos, File, Markup, ChatMember, InlineQueryResult, GameHighScore, InlineKeyboard, InputMediaVideo, InputMediaPhoto, QuizType, Poll } from './types';
import { MatchType, MatchResultCommand } from './matcher';
import { Listener } from '../utils';
export interface Config {
secret: string;
apiUrl?: string;
}
interface On {

@@ -32,2 +37,3 @@ (event: MatchType.Message, listener: Listener<ArgumentMessage>): void;

}
export declare type SendFile = string | Buffer;
export declare class Bot extends AbstractBot<Config, Update> implements IBotPolling {

@@ -39,3 +45,308 @@ static readonly defaultConfig: Config;

private handleParamsForFiles;
request: Request;
request: <T>(apiMethod: string, params?: Record<string, any>) => Promise<T>;
/**
* Public API
*/
getUpdates: (props: {
offset?: number;
limit?: number;
timeout?: number;
allowed_updates?: ("message" | "edited_message" | "channel_post" | "edited_channel_post" | "inline_query" | "chosen_inline_result" | "callback_query")[];
}) => Promise<Update[]>;
setWebhook: (props: {
url: string;
certificate?: string | Buffer;
max_connections?: number;
allowed_updates?: ("message" | "edited_message" | "channel_post" | "edited_channel_post" | "inline_query" | "chosen_inline_result" | "callback_query")[];
}) => Promise<true>;
deleteWebhook: () => Promise<true>;
getWebhookInfo: () => Promise<WebhookInfo>;
getMe: () => Promise<User>;
sendMessage: (props: {
chat_id: string | number;
text: string;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
}) => Promise<Message>;
forwardMessage: (props: {
chat_id: string | number;
from_chat_id: string | number;
message_id: number;
disable_notification?: boolean;
}) => Promise<Message>;
sendPhoto: (props: {
chat_id: string | number;
caption: string;
photo: string | Buffer;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
}) => Promise<Message>;
sendAudio: (props: {
chat_id: string | number;
caption?: string;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
audio: string | Buffer;
}) => Promise<Message>;
sendDocument: (props: {
chat_id: string | number;
caption?: string;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
document: string | Buffer;
thumb?: string | Buffer;
}) => Promise<Message>;
sendVideo: (props: {
chat_id: string | number;
caption?: string;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
video: string | Buffer;
duration?: number;
width?: number;
height?: number;
thumb?: string | Buffer;
supports_streaming?: boolean;
}) => Promise<Message>;
sendAnimation: (props: {
chat_id: string | number;
caption?: string;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
animation: string | Buffer;
duration?: number;
width?: number;
height?: number;
thumb?: string | Buffer;
}) => Promise<Message>;
sendVoice: (props: {
chat_id: string | number;
caption?: string;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
voice: string | Buffer;
duration?: number;
}) => Promise<Message>;
sendVideoNote: (props: {
chat_id: string | number;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
video_note: string | Buffer;
duration?: number;
length?: number;
thumb?: string | Buffer;
}) => Promise<Message>;
sendMediaGroup: (props: {
chat_id: string | number;
media: (InputMediaPhoto | InputMediaVideo)[];
}) => Promise<Message>;
sendLocation: (props: {
chat_id: string | number;
caption?: string;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
latitude: number;
longitude: number;
live_period?: number;
}) => Promise<Message>;
editMessageLiveLocation: (props: {
chat_id: string | number;
message_id?: number;
inline_message_id?: number;
latitude: number;
longitude: number;
reply_markup?: InlineKeyboard;
}) => Promise<Message>;
stopMessageLiveLocation: (props: {
chat_id: string | number;
disable_notification?: boolean;
reply_to_message_id?: number;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
message_id?: number;
inline_message_id?: number;
reply_markup?: InlineKeyboard;
}) => Promise<Message>;
sendVenue: (props: {
chat_id: string | number;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
latitude: number;
longitude: number;
title: string;
address: string;
foursquare_id?: string;
foursquare_type?: string;
}) => Promise<Message>;
sendContact: (props: {
chat_id: string | number;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
phone_number: string;
first_name: string;
last_name?: string;
vcard?: string;
}) => Promise<Message>;
sendPoll: (props: {
chat_id: string | number;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
question: string;
options: string[];
is_anonymous?: boolean;
type?: QuizType;
allows_multiple_answers?: boolean;
correct_option_id?: number;
is_closed?: boolean;
}) => Promise<Message>;
sendChatAction: (props: {
chat_id: string | number;
action: ChatAction;
}) => Promise<true>;
getUserProfilePhotos: (props: {
user_id: number;
offset?: number;
limit?: number;
}) => Promise<UserProfilePhotos>;
getFile: (props: {
file_id: string;
}) => Promise<File>;
getChat: (props: {
chat_id: string | number;
}) => Promise<Chat>;
getChatAdministrators: (props: {
chat_id: string | number;
}) => Promise<ChatMember[]>;
getChatMembersCount: (props: {
chat_id: string | number;
}) => Promise<number>;
getChatMember: (props: {
chat_id: string | number;
user_id: number;
}) => Promise<ChatMember>;
answerCallbackQuery: (props: {
callback_query_id: string;
text?: string;
show_alert?: boolean;
url?: string;
cache_time?: number;
}) => Promise<true>;
editMessageText: (props: {
chat_id: string | number;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
message_id?: number;
inline_message_id?: number;
text: string;
}) => Promise<true | Message>;
editMessageCaption: (props: {
chat_id: string | number;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
parse_mode?: ParseMode;
disable_web_page_preview?: boolean;
message_id?: number;
inline_message_id?: number;
caption: string;
}) => Promise<true | Message>;
editMessageMedia: (props: {
chat_id: string | number;
message_id?: number;
inline_message_id?: number;
media?: (InputMediaPhoto | InputMediaVideo)[];
reply_markup?: InlineKeyboard;
}) => Promise<true | Message>;
editMessageReplyMarkup: (props: {
chat_id: string | number;
message_id?: number;
inline_message_id?: number;
reply_markup?: InlineKeyboard;
}) => Promise<true | Message>;
stopPoll: (props: {
chat_id: string | number;
message_id: number;
reply_markup?: InlineKeyboard;
}) => Promise<Poll>;
deleteMessage: (props: {
chat_id: string | number;
message_id: number;
}) => Promise<true>;
sendSticker: (props: {
chat_id: string | number;
sticker: string;
disable_notification?: boolean;
reply_to_message_id?: number;
reply_markup?: Markup;
}) => Promise<Message>;
answerInlineQuery: (props: {
inline_query_id: string;
results: InlineQueryResult[];
cache_time?: number;
is_personal?: boolean;
next_offset?: string;
switch_pm_text?: string;
switch_pm_parameter?: string;
}) => Promise<true>;
sendGame: (props: {
chat_id: string | number;
game_short_name: string;
}) => Promise<Message>;
setGameScore: (props: {
chat_id: string | number;
user_id: number;
score: number;
force?: boolean;
disable_edit_message?: boolean;
message_id?: number;
inline_message_id?: number;
}) => Promise<true | Message>;
getGameHighScores: (props: {
user_id: number;
chat_id?: number;
message_id?: number;
inline_message_id?: number;
}) => Promise<GameHighScore[]>;
/**
* Events
*/
private readonly events;

@@ -53,2 +364,4 @@ on: On;

}
export { ParseMode } from './types/send';
export * from './matcher';
export * from './utils';

@@ -70,2 +70,52 @@ "use strict";

});
/**
* Public API
*/
this.getUpdates = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('getUpdates', props); });
this.setWebhook = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('setWebhook', props); });
this.deleteWebhook = () => __awaiter(this, void 0, void 0, function* () { return this.request('deleteWebhook'); });
this.getWebhookInfo = () => __awaiter(this, void 0, void 0, function* () { return this.request('getWebhookInfo'); });
this.getMe = () => __awaiter(this, void 0, void 0, function* () { return this.request('getMe'); });
this.sendMessage = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendMessage', props); });
this.forwardMessage = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('forwardMessage', props); });
this.sendPhoto = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendPhoto', props); });
this.sendAudio = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendAudio', props); });
this.sendDocument = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendDocument', props); });
this.sendVideo = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendVideo', props); });
this.sendAnimation = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendAnimation', props); });
this.sendVoice = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendVoice', props); });
this.sendVideoNote = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendVideoNote', props); });
this.sendMediaGroup = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendMediaGroup', props); });
this.sendLocation = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendLocation', props); });
this.editMessageLiveLocation = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('editMessageLiveLocation', props); });
this.stopMessageLiveLocation = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('stopMessageLiveLocation', props); });
this.sendVenue = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendVenue', props); });
this.sendContact = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendContact', props); });
this.sendPoll = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendPoll', props); });
// ...
this.sendChatAction = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendChatAction', props); });
this.getUserProfilePhotos = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('getUserProfilePhotos', props); });
this.getFile = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('getFile', props); });
// ...
this.getChat = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('getChat', props); });
this.getChatAdministrators = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('getChatAdministrators', props); });
this.getChatMembersCount = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('getChatMembersCount', props); });
this.getChatMember = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('getChatMember', props); });
// ...
this.answerCallbackQuery = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('answerCallbackQuery', props); });
this.editMessageText = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('editMessageText', props); });
this.editMessageCaption = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('editMessageCaption', props); });
this.editMessageMedia = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('editMessageMedia', props); });
this.editMessageReplyMarkup = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('editMessageReplyMarkup', props); });
this.stopPoll = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('stopPoll', props); });
this.deleteMessage = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('deleteMessage', props); });
this.sendSticker = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendSticker', props); });
// ...
this.answerInlineQuery = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('answerInlineQuery', props); });
this.sendGame = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendGame', props); });
this.setGameScore = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('setGameScore', props); });
this.getGameHighScores = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('getGameHighScores', props); });
/**
* Events
*/
this.events = {};

@@ -104,3 +154,3 @@ this.on = (event, listener) => {

return new Promise(resolve => {
this.request('getUpdates', {
this.getUpdates({
offset: this.pollingOffset

@@ -128,3 +178,4 @@ }).then(response => {

};
__export(require("./matcher"));
__export(require("./utils"));
//# sourceMappingURL=index.js.map

191

dist/telegram/types/api.d.ts

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

/// <reference types="node" />
import { Stream } from 'stream';
import { Update, WebhookInfo, User, UserProfilePhotos, Chat, ChatMember, BaseOption, SendMessageOptions, SendMediaOptions, ChatAction, ParseMode, Message, InputMediaPhoto, InputMediaVideo, QuizType, File, Poll, InlineKeyboard, SendExtraOptions, GameHighScore } from '.';
import { InlineQueryResult } from './inline-query';
export interface Config {
secret: string;
apiUrl?: string;
}
export declare type SendFile = string | Stream | Buffer;
export interface Request {
(method: 'getUpdates', params: {
offset?: number;
limit?: number;
timeout?: number;
allowed_updates?: (Exclude<keyof Update, 'update_id'>)[];
}): Promise<Update[]>;
(method: 'setWebhook', params: {
url: string;
certificate?: SendFile;
max_connections?: number;
allowed_updates?: (Exclude<keyof Update, 'update_id'>)[];
}): Promise<true>;
(method: 'deleteWebhook'): Promise<true>;
(method: 'getWebhookInfo'): Promise<WebhookInfo>;
(method: 'getMe'): Promise<User>;
(method: 'sendMessage', params: BaseOption & {
text: string;
} & SendMessageOptions): Promise<Message>;
(method: 'forwardMessage', params: BaseOption & {
forom_chat_id: number | string;
message_id: number;
disable_notification?: boolean;
}): Promise<Message>;
(method: 'sendPhoto', params: BaseOption & SendMediaOptions & {
photo: SendFile;
}): Promise<Message>;
(method: 'sendAudio', params: BaseOption & SendMediaOptions & {
audio: SendFile;
}): Promise<Message>;
(method: 'sendDocument', params: BaseOption & SendMediaOptions & {
document: SendFile;
thumb?: SendFile;
}): Promise<Message>;
(method: 'sendVideo', params: BaseOption & SendMediaOptions & {
video: SendFile;
duration?: number;
width?: number;
height?: number;
thumb?: SendFile;
supports_streaming?: boolean;
}): Promise<Message>;
(method: 'sendAnimation', params: BaseOption & SendMediaOptions & {
animation: SendFile;
duration?: number;
width?: number;
height?: number;
thumb?: SendFile;
}): Promise<Message>;
(method: 'sendVoice', params: BaseOption & SendMediaOptions & {
voice: SendFile;
duration?: number;
}): Promise<Message>;
(method: 'sendVideoNote', params: BaseOption & SendMessageOptions & {
video_note: SendFile;
duration?: number;
length?: number;
thumb?: SendFile;
}): Promise<Message>;
(method: 'sendMediaGroup', params: BaseOption & {
media: (InputMediaPhoto | InputMediaVideo)[];
}): Promise<Message>;
(method: 'sendLocation', params: BaseOption & SendMediaOptions & {
latitude: number;
longitude: number;
live_period?: number;
}): Promise<Message>;
(method: 'editMessageLiveLocation', params: BaseOption & {
message_id?: number;
inline_message_id?: number;
latitude: number;
longitude: number;
reply_markup?: InlineKeyboard;
}): Promise<Message>;
(method: 'stopMessageLiveLocation', params: BaseOption & SendMessageOptions & {
message_id?: number;
inline_message_id?: number;
reply_markup?: InlineKeyboard;
}): Promise<Message>;
(method: 'sendVenue', params: BaseOption & SendMessageOptions & {
latitude: number;
longitude: number;
title: string;
address: string;
foursquare_id?: string;
foursquare_type?: string;
}): Promise<Message>;
(method: 'sendContact', params: BaseOption & SendMessageOptions & {
phone_number: string;
first_name: string;
last_name?: string;
vcard?: string;
}): Promise<Message>;
(method: 'sendPoll', params: BaseOption & SendMessageOptions & {
question: string;
options: string[];
is_anonymous?: boolean;
type?: QuizType;
allows_multiple_answers?: boolean;
correct_option_id?: number;
is_closed?: boolean;
}): Promise<Message>;
(method: 'sendChatAction', params: BaseOption & {
action: ChatAction;
}): Promise<true>;
(method: 'getUserProfilePhotos', params: {
user_id: number;
offset?: number;
limit?: number;
}): Promise<UserProfilePhotos>;
(method: 'getFile', params: {
file_id: string;
}): Promise<File>;
(method: 'getChat', params: BaseOption): Promise<Chat>;
(method: 'getChatAdministrators', params: BaseOption): Promise<ChatMember>;
(method: 'getChatMembersCount', params: BaseOption): Promise<number>;
(method: 'getChatMember', params: BaseOption & {
user_id: number;
}): Promise<ChatMember>;
(method: 'answerCallbackQuery', params: {
callback_query_id: string;
text?: string;
show_alert?: boolean;
url?: string;
cache_time?: number;
}): Promise<true>;
(method: 'editMessageText', params: BaseOption & SendMessageOptions & {
message_id?: number;
inline_message_id?: number;
text: string;
reply_markup?: ParseMode;
}): Promise<Message | true>;
(method: 'editMessageCaption', params: BaseOption & SendMediaOptions & {
message_id?: number;
inline_message_id?: number;
}): Promise<Message | true>;
(method: 'editMessageMedia', params: BaseOption & {
message_id?: number;
inline_message_id?: number;
media?: (InputMediaPhoto | InputMediaVideo)[];
reply_markup?: InlineKeyboard;
}): Promise<Message | true>;
(method: 'editMessageReplyMarkup', params: BaseOption & {
message_id?: number;
inline_message_id?: number;
reply_markup?: InlineKeyboard;
}): Promise<Message | true>;
(method: 'stopPoll', params: BaseOption & {
message_id: number;
reply_markup?: InlineKeyboard;
}): Promise<Poll>;
(method: 'deleteMessage', params: BaseOption & {
message_id: number;
}): Promise<true>;
(method: 'sendSticker', params: BaseOption & {
sticker: string;
} & SendExtraOptions): Promise<Message>;
(method: 'answerInlineQuery', params: {
inline_query_id: string;
results: InlineQueryResult[];
cache_time?: number;
is_personal?: boolean;
next_offset?: string;
switch_pm_text?: string;
switch_pm_parameter?: string;
}): Promise<true>;
(method: 'sendGame', params: BaseOption & {
game_short_name: string;
} & SendExtraOptions): Promise<Message>;
(method: 'setGameScore', params: Partial<BaseOption> & {
user_id: number;
score: number;
force?: boolean;
disable_edit_message?: boolean;
message_id?: number;
inline_message_id?: number;
}): Promise<Message | true>;
(method: 'getGameHighScores', params: {
user_id: number;
chat_id?: number;
message_id?: number;
inline_message_id?: number;
}): Promise<GameHighScore[]>;
}
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./send"));
//# sourceMappingURL=index.js.map
import { Markup } from '.';
export declare type ParseMode = 'Markdown' | 'MarkdownV2' | 'HTML';
export declare const enum ParseMode {
Markdown = "Markdown",
MarkdownV2 = "MarkdownV2",
HTML = "HTML"
}
export declare type BaseOption = {

@@ -4,0 +8,0 @@ chat_id: number | string;

import { Message, SendMessageOptions } from '../types';
import { Bot } from '..';
export declare const fastReply: (bot: Bot, message: Message, text: string, options?: SendMessageOptions) => Promise<Message>;
export declare const fastReply: (bot: Bot, message: Message, text: string, options?: SendMessageOptions) => Promise<unknown>;

@@ -39,2 +39,3 @@ import AbstractBot, { IBotPolling } from '../abstract-bot';

}
export * from './matcher';
export * from './utils';

@@ -120,3 +120,4 @@ "use strict";

};
__export(require("./matcher"));
__export(require("./utils"));
//# sourceMappingURL=index.js.map
{
"name": "@apidog/multibot-sdk-ts",
"version": "0.0.8-0",
"version": "0.0.8-1",
"description": "Telegram and VK bot SDK for TypeScript",

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

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc