@apidog/multibot-sdk-ts
Advanced tools
Comparing version 0.0.8-6 to 0.1.0
/// <reference types="node" /> | ||
import AbstractBot, { IBotPolling } from '../abstract-bot'; | ||
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 { User, Message, Update, CallbackQuery, Chat, InlineQuery, ChosenInlineResult, Location, WebhookInfo, ParseMode, ChatAction, UserProfilePhotos, File, Markup, ChatMember, InlineQueryResult, GameHighScore, InlineKeyboard, InputMediaVideo, InputMediaPhoto, QuizType, Poll, MessageEntity, BotCommand } from './types'; | ||
import { MatchType, MatchResultCommand } from './matcher'; | ||
@@ -39,3 +39,3 @@ import { Listener } from '../utils'; | ||
export declare class Bot extends AbstractBot<Config, Update> implements IBotPolling { | ||
static readonly defaultConfig: Config; | ||
private static readonly defaultConfig; | ||
constructor(config: Config); | ||
@@ -66,7 +66,21 @@ protected getApiEndpoint: (method: string) => string; | ||
text: string; | ||
parse_mode?: ParseMode; | ||
entities?: MessageEntity[]; | ||
disable_web_page_preview?: boolean; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
}) => Promise<Message>; | ||
copyMessage: (props: { | ||
chat_id: number | string; | ||
from_chat_id: number | string; | ||
message_id: number; | ||
caption?: string; | ||
parse_mode?: ParseMode; | ||
disable_web_page_preview?: boolean; | ||
caption_entities?: MessageEntity[]; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
}) => Promise<Message>; | ||
@@ -81,39 +95,41 @@ forwardMessage: (props: { | ||
chat_id: number | string; | ||
photo: SendFile; | ||
caption: string; | ||
photo: SendFile; | ||
parse_mode?: ParseMode; | ||
caption_entities?: MessageEntity[]; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
parse_mode?: ParseMode; | ||
disable_web_page_preview?: boolean; | ||
}) => Promise<Message>; | ||
sendAudio: (props: { | ||
chat_id: number | string; | ||
audio: SendFile; | ||
caption?: string; | ||
parse_mode?: ParseMode; | ||
caption_entities?: MessageEntity[]; | ||
duration?: number; | ||
performer?: string; | ||
title?: string; | ||
thumb?: SendFile; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
parse_mode?: ParseMode; | ||
disable_web_page_preview?: boolean; | ||
audio: SendFile; | ||
}) => Promise<Message>; | ||
sendDocument: (props: { | ||
chat_id: number | string; | ||
document: SendFile; | ||
thumb?: SendFile; | ||
caption?: string; | ||
parse_mode?: ParseMode; | ||
caption_entities?: MessageEntity[]; | ||
disable_content_type_detection?: boolean; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
reply_markup?: Markup; | ||
parse_mode?: ParseMode; | ||
disable_web_page_preview?: boolean; | ||
document: SendFile; | ||
thumb?: SendFile; | ||
allow_sending_without_reply?: boolean; | ||
}) => Promise<Message>; | ||
sendVideo: (props: { | ||
chat_id: number | string; | ||
caption?: string; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
reply_markup?: Markup; | ||
parse_mode?: ParseMode; | ||
disable_web_page_preview?: boolean; | ||
video: SendFile; | ||
@@ -124,12 +140,13 @@ duration?: number; | ||
thumb?: SendFile; | ||
caption?: string; | ||
parse_mode?: ParseMode; | ||
caption_entities?: MessageEntity[]; | ||
supports_streaming?: boolean; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
}) => Promise<Message>; | ||
sendAnimation: (props: { | ||
chat_id: number | string; | ||
caption?: string; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
reply_markup?: Markup; | ||
parse_mode?: ParseMode; | ||
disable_web_page_preview?: boolean; | ||
animation: SendFile; | ||
@@ -140,19 +157,24 @@ duration?: number; | ||
thumb?: SendFile; | ||
caption?: string; | ||
parse_mode?: ParseMode; | ||
caption_entities?: MessageEntity[]; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
}) => Promise<Message>; | ||
sendVoice: (props: { | ||
chat_id: number | string; | ||
voice: SendFile; | ||
duration?: number; | ||
caption?: string; | ||
parse_mode?: ParseMode; | ||
caption_entities?: MessageEntity[]; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
parse_mode?: ParseMode; | ||
disable_web_page_preview?: boolean; | ||
voice: SendFile; | ||
duration?: number; | ||
}) => Promise<Message>; | ||
sendVideoNote: (props: { | ||
chat_id: number | string; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
reply_markup?: Markup; | ||
video_note: SendFile; | ||
@@ -162,2 +184,6 @@ duration?: number; | ||
thumb?: SendFile; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
}) => Promise<Message>; | ||
@@ -167,12 +193,18 @@ sendMediaGroup: (props: { | ||
media: (InputMediaPhoto | InputMediaVideo)[]; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
}) => Promise<Message>; | ||
sendLocation: (props: { | ||
chat_id: number | string; | ||
caption?: string; | ||
latitude: number; | ||
longitude: number; | ||
horizontal_accuracy?: number; | ||
live_period?: number; | ||
heading?: number; | ||
proximity_alert_radius?: number; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
latitude: number; | ||
longitude: number; | ||
live_period?: number; | ||
}) => Promise<Message>; | ||
@@ -185,2 +217,5 @@ editMessageLiveLocation: (props: { | ||
longitude: number; | ||
horizontal_accuracy?: number; | ||
heading?: number; | ||
proximity_alert_radius?: number; | ||
reply_markup?: InlineKeyboard; | ||
@@ -190,5 +225,2 @@ }) => Promise<Message>; | ||
chat_id: number | string; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
disable_web_page_preview?: boolean; | ||
message_id?: number; | ||
@@ -200,5 +232,2 @@ inline_message_id?: number; | ||
chat_id: number | string; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
reply_markup?: Markup; | ||
latitude: number; | ||
@@ -210,8 +239,11 @@ longitude: number; | ||
foursquare_type?: string; | ||
google_place_id?: string; | ||
google_place_tye?: string; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
}) => Promise<Message>; | ||
sendContact: (props: { | ||
chat_id: number | string; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
reply_markup?: Markup; | ||
phone_number: string; | ||
@@ -221,10 +253,9 @@ first_name: string; | ||
vcard?: string; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
}) => Promise<Message>; | ||
sendPoll: (props: { | ||
chat_id: number | string; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
reply_markup?: Markup; | ||
parse_mode?: ParseMode; | ||
disable_web_page_preview?: boolean; | ||
question: string; | ||
@@ -236,4 +267,21 @@ options: string[]; | ||
correct_option_id?: number; | ||
explanation?: string; | ||
explanation_parse_mode?: ParseMode; | ||
explanation_entities?: MessageEntity[]; | ||
open_period?: number; | ||
close_date?: number; | ||
is_closed?: boolean; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
}) => Promise<Message>; | ||
sendDice: (props: { | ||
chat_id: number | string; | ||
emoji: string; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
}) => Promise<Message>; | ||
sendChatAction: (props: { | ||
@@ -271,23 +319,24 @@ chat_id: number | string; | ||
}) => Promise<true>; | ||
setMyCommands: (props: { | ||
commands: BotCommand[]; | ||
}) => Promise<true>; | ||
getMyCommands: () => Promise<BotCommand[]>; | ||
editMessageText: (props: { | ||
chat_id: number | string; | ||
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; | ||
parse_mode?: ParseMode; | ||
entities?: MessageEntity[]; | ||
disable_web_page_preview?: boolean; | ||
reply_markup?: Markup; | ||
}) => Promise<Message | true>; | ||
editMessageCaption: (props: { | ||
chat_id: number | string; | ||
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; | ||
parse_mode?: ParseMode; | ||
caption_entities?: MessageEntity[]; | ||
reply_markup?: Markup; | ||
}) => Promise<Message | true>; | ||
@@ -318,5 +367,6 @@ editMessageMedia: (props: { | ||
chat_id: number | string; | ||
sticker: string; | ||
sticker: SendFile; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
@@ -336,5 +386,8 @@ }) => Promise<Message>; | ||
game_short_name: string; | ||
disable_notification?: boolean; | ||
reply_to_message_id?: number; | ||
allow_sending_without_reply?: boolean; | ||
reply_markup?: Markup; | ||
}) => Promise<Message>; | ||
setGameScore: (props: { | ||
chat_id: number | string; | ||
user_id: number; | ||
@@ -344,2 +397,3 @@ score: number; | ||
disable_edit_message?: boolean; | ||
chat_id?: number | string; | ||
message_id?: number; | ||
@@ -369,5 +423,4 @@ inline_message_id?: number; | ||
} | ||
export { ParseMode } from './types/send'; | ||
export * from './types'; | ||
export * from './matcher'; | ||
export * from './utils'; |
@@ -72,2 +72,3 @@ "use strict"; | ||
this.sendMessage = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendMessage', utils_1.sanitizeMarkdownV2Props(props)); }); | ||
this.copyMessage = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('copyMessage', utils_1.sanitizeMarkdownV2Props(props, 'caption')); }); | ||
this.forwardMessage = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('forwardMessage', props); }); | ||
@@ -88,7 +89,21 @@ this.sendPhoto = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendPhoto', utils_1.sanitizeMarkdownV2Props(props, 'caption')); }); | ||
this.sendPoll = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendPoll', props); }); | ||
// ... | ||
this.sendDice = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendDice', 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); }); | ||
// ... | ||
// kickChatMember | ||
// unbanChatMember | ||
// restrictChatMember | ||
// promoteChatMember | ||
// setChatAdministratorCustomTitle | ||
// setChatPermissions | ||
// exportChatInviteLink | ||
// setChatPhoto | ||
// deleteChatPhoto | ||
// setChatTitle | ||
// setChatDescription | ||
// pinChatMessage | ||
// unpinChatMessage | ||
// unpinAllChatMessages | ||
// leaveChat | ||
this.getChat = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('getChat', props); }); | ||
@@ -98,4 +113,7 @@ this.getChatAdministrators = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('getChatAdministrators', props); }); | ||
this.getChatMember = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('getChatMember', props); }); | ||
// ... | ||
// setChatStickerSet | ||
// deleteChatStickerSet | ||
this.answerCallbackQuery = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('answerCallbackQuery', props); }); | ||
this.setMyCommands = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('setMyCommands', props); }); | ||
this.getMyCommands = () => __awaiter(this, void 0, void 0, function* () { return this.request('getMyCommands'); }); | ||
this.editMessageText = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('editMessageText', props); }); | ||
@@ -108,4 +126,12 @@ this.editMessageCaption = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('editMessageCaption', utils_1.sanitizeMarkdownV2Props(props, 'caption')); }); | ||
this.sendSticker = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendSticker', props); }); | ||
// ... | ||
// getStickerSet | ||
// uploadStickerFile | ||
// createNewStickerSet | ||
// addStickerToSet | ||
// setStickerPositionInSet | ||
// deleteStickerFromSet | ||
// setStickerSetThumb | ||
this.answerInlineQuery = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('answerInlineQuery', props); }); | ||
// Payments all | ||
// Telegram Passport all | ||
this.sendGame = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendGame', props); }); | ||
@@ -123,2 +149,3 @@ this.setGameScore = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('setGameScore', props); }); | ||
this.events[event].push(listener); | ||
return this; | ||
}; | ||
@@ -151,5 +178,4 @@ this.handleUpdate = (update) => { | ||
return new Promise(resolve => { | ||
this.getUpdates({ | ||
offset: this.pollingOffset | ||
}).then(response => { | ||
this.getUpdates({ offset: this.pollingOffset }) | ||
.then(response => { | ||
if (response.length) { | ||
@@ -156,0 +182,0 @@ this.pollingOffset = response[response.length - 1].update_id + 1; |
@@ -29,1 +29,5 @@ import { Markup } from '.'; | ||
export declare type ChatAction = 'typing' | 'upload_photo' | 'record_video' | 'upload_video' | 'record_audio' | 'upload_audio' | 'upload_document' | 'find_location' | 'record_video_note' | 'upload_video_note'; | ||
export declare type BotCommand = { | ||
command: string; | ||
description: string; | ||
}; |
{ | ||
"name": "@apidog/multibot-sdk-ts", | ||
"version": "0.0.8-6", | ||
"version": "0.1.0", | ||
"description": "Telegram and VK bot SDK for TypeScript", | ||
@@ -27,14 +27,14 @@ "main": "dist/index.js", | ||
"axios": "0.21.1", | ||
"form-data": "3.0.0" | ||
"form-data": "4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "26.0.19", | ||
"@types/node": "14.14.16", | ||
"@typescript-eslint/eslint-plugin": "4.11.1", | ||
"@typescript-eslint/parser": "4.11.1", | ||
"@types/jest": "26.0.20", | ||
"@types/node": "14.14.31", | ||
"@typescript-eslint/eslint-plugin": "4.15.2", | ||
"@typescript-eslint/parser": "4.15.2", | ||
"dotenv": "8.2.0", | ||
"eslint": "7.16.0", | ||
"eslint": "7.20.0", | ||
"jest": "26.6.3", | ||
"ts-jest": "26.4.4", | ||
"typescript": "4.1.3" | ||
"ts-jest": "26.5.1", | ||
"typescript": "4.1.5" | ||
}, | ||
@@ -41,0 +41,0 @@ "bugs": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
161522
120
2448
+ Addedform-data@4.0.0(transitive)
- Removedform-data@3.0.0(transitive)
Updatedform-data@4.0.0