@apidog/multibot-sdk-ts
Advanced tools
Comparing version 0.0.8-1 to 0.0.8-2
@@ -154,4 +154,2 @@ /// <reference types="node" /> | ||
reply_markup?: Markup; | ||
parse_mode?: ParseMode; | ||
disable_web_page_preview?: boolean; | ||
video_note: string | Buffer; | ||
@@ -172,4 +170,2 @@ duration?: number; | ||
reply_markup?: Markup; | ||
parse_mode?: ParseMode; | ||
disable_web_page_preview?: boolean; | ||
latitude: number; | ||
@@ -191,3 +187,2 @@ longitude: number; | ||
reply_to_message_id?: number; | ||
parse_mode?: ParseMode; | ||
disable_web_page_preview?: boolean; | ||
@@ -203,4 +198,2 @@ message_id?: number; | ||
reply_markup?: Markup; | ||
parse_mode?: ParseMode; | ||
disable_web_page_preview?: boolean; | ||
latitude: number; | ||
@@ -218,4 +211,2 @@ longitude: number; | ||
reply_markup?: Markup; | ||
parse_mode?: ParseMode; | ||
disable_web_page_preview?: boolean; | ||
phone_number: string; | ||
@@ -222,0 +213,0 @@ first_name: string; |
@@ -20,2 +20,3 @@ "use strict"; | ||
const matcher_1 = require("./matcher"); | ||
const utils_1 = require("./utils"); | ||
class Bot extends abstract_bot_1.default { | ||
@@ -79,10 +80,10 @@ constructor(config) { | ||
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.sendMessage = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendMessage', utils_1.sanitizeMarkdownV2Props(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.sendPhoto = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendPhoto', utils_1.sanitizeMarkdownV2Props(props, 'caption')); }); | ||
this.sendAudio = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendAudio', utils_1.sanitizeMarkdownV2Props(props, 'caption')); }); | ||
this.sendDocument = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendDocument', utils_1.sanitizeMarkdownV2Props(props, 'caption')); }); | ||
this.sendVideo = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendVideo', utils_1.sanitizeMarkdownV2Props(props, 'caption')); }); | ||
this.sendAnimation = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendAnimation', utils_1.sanitizeMarkdownV2Props(props, 'caption')); }); | ||
this.sendVoice = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendVoice', utils_1.sanitizeMarkdownV2Props(props, 'caption')); }); | ||
this.sendVideoNote = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendVideoNote', props); }); | ||
@@ -108,3 +109,3 @@ this.sendMediaGroup = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('sendMediaGroup', 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.editMessageCaption = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('editMessageCaption', utils_1.sanitizeMarkdownV2Props(props, 'caption')); }); | ||
this.editMessageMedia = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('editMessageMedia', props); }); | ||
@@ -111,0 +112,0 @@ this.editMessageReplyMarkup = (props) => __awaiter(this, void 0, void 0, function* () { return this.request('editMessageReplyMarkup', props); }); |
@@ -0,1 +1,2 @@ | ||
import { ParseMode } from '../types'; | ||
declare type MdV2fx = (text: string) => string; | ||
@@ -11,3 +12,7 @@ declare type MdV2link = (url: string, label: string) => string; | ||
static codeBlock: MdV2fx; | ||
static sanitizeString: (text: string) => string; | ||
} | ||
export declare const sanitizeMarkdownV2Props: <T extends Record<string, any> & { | ||
parse_mode?: ParseMode; | ||
}>(props: T, key?: string) => T; | ||
export {}; |
@@ -29,3 +29,11 @@ "use strict"; | ||
MarkdownV2.codeLine = text => wrapString(text, '`'); | ||
MarkdownV2.codeBlock = text => `\`\`\`${escapeChars(text, ['```'])}\`\`\``; | ||
MarkdownV2.codeBlock = text => `\`\`\`${escapeChars(text, ['`'])}\`\`\``; | ||
MarkdownV2.sanitizeString = (text) => text.replace(/([_*[\]()~`>#+=|{}.!-])/ig, '\\$1'); | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
exports.sanitizeMarkdownV2Props = (props, key = 'text') => { | ||
if (props.parse_mode === "MarkdownV2" /* MarkdownV2 */) { | ||
props[key] = MarkdownV2.sanitizeString(props[key]); | ||
} | ||
return props; | ||
}; | ||
//# sourceMappingURL=md-v2.js.map |
{ | ||
"name": "@apidog/multibot-sdk-ts", | ||
"version": "0.0.8-1", | ||
"version": "0.0.8-2", | ||
"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
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
192960
2828