@xbibzlibrary/telebibz 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.id.md +3 -12
- package/README.md +8 -8
- package/README.zh-CN.md +2 -11
- package/assets/readme-preview.html +2 -2
- package/dist/src/branding/terminal.js +1 -1
- package/dist/src/branding/terminal.js.map +1 -1
- package/dist/src/core/bot.d.ts +1 -4
- package/dist/src/core/bot.d.ts.map +1 -1
- package/dist/src/core/bot.js +3 -18
- package/dist/src/core/bot.js.map +1 -1
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/observability/logger.d.ts +6 -0
- package/dist/src/observability/logger.d.ts.map +1 -1
- package/dist/src/observability/logger.js +56 -11
- package/dist/src/observability/logger.js.map +1 -1
- package/dist/src/testing.d.ts.map +1 -1
- package/dist/src/testing.js +1 -9
- package/dist/src/testing.js.map +1 -1
- package/dist-cjs/src/branding/terminal.js +1 -1
- package/dist-cjs/src/core/bot.js +3 -18
- package/dist-cjs/src/index.js +0 -2
- package/dist-cjs/src/observability/logger.js +56 -11
- package/dist-cjs/src/testing.js +1 -9
- package/docs/API.id.md +7 -95
- package/docs/API.md +13 -87
- package/docs/API.zh-CN.md +7 -95
- package/package.json +1 -2
- package/APPROVAL_FEATURE.md +0 -73
- package/dist/src/approval/approval.d.ts +0 -66
- package/dist/src/approval/approval.d.ts.map +0 -1
- package/dist/src/approval/approval.js +0 -105
- package/dist/src/approval/approval.js.map +0 -1
- package/dist/src/branding/branding.d.ts +0 -17
- package/dist/src/branding/branding.d.ts.map +0 -1
- package/dist/src/branding/branding.js +0 -35
- package/dist/src/branding/branding.js.map +0 -1
- package/dist-cjs/src/approval/approval.js +0 -110
- package/dist-cjs/src/branding/branding.js +0 -39
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TELEBIBZ_BRAND_TEXT = void 0;
|
|
4
|
-
exports.buildBrandingBox = buildBrandingBox;
|
|
5
|
-
exports.buildApprovalNotification = buildApprovalNotification;
|
|
6
|
-
exports.TELEBIBZ_BRAND_TEXT = "Library Bot Telegram By @xbibzofficial";
|
|
7
|
-
/**
|
|
8
|
-
* Telegram does not support arbitrary font colors. Colored square markers and a
|
|
9
|
-
* monospace Unicode box provide a portable colored/boxed treatment in clients.
|
|
10
|
-
*/
|
|
11
|
-
function buildBrandingBox(options = {}) {
|
|
12
|
-
const title = options.title ?? "TELEBIBZ";
|
|
13
|
-
const footer = options.footer ?? exports.TELEBIBZ_BRAND_TEXT;
|
|
14
|
-
const safeFooter = escapeHtml(footer);
|
|
15
|
-
const innerWidth = Math.max(32, [...safeFooter].length);
|
|
16
|
-
const horizontal = "─".repeat(innerWidth + 2);
|
|
17
|
-
return [
|
|
18
|
-
`🟦 <b>${escapeHtml(title)}</b> 🟪`,
|
|
19
|
-
`<pre>┌${horizontal}┐`,
|
|
20
|
-
`│ ${padBox(safeFooter, innerWidth)} │`,
|
|
21
|
-
`└${horizontal}┘</pre>`,
|
|
22
|
-
].join("\n");
|
|
23
|
-
}
|
|
24
|
-
function buildApprovalNotification(details) {
|
|
25
|
-
return [
|
|
26
|
-
buildBrandingBox(),
|
|
27
|
-
"",
|
|
28
|
-
`Haloo ${escapeHtml(details.ownerLabel)}, ada yang memakai library telebibz nihh`,
|
|
29
|
-
"",
|
|
30
|
-
escapeHtml(details.botLine),
|
|
31
|
-
escapeHtml(details.ownerIdLine),
|
|
32
|
-
"Status: menunggu izin owner.",
|
|
33
|
-
].join("\n");
|
|
34
|
-
}
|
|
35
|
-
function padBox(value, width) {
|
|
36
|
-
const safe = [...value].slice(0, width).join("");
|
|
37
|
-
return `${safe}${" ".repeat(Math.max(0, width - [...safe].length))}`;
|
|
38
|
-
}
|
|
39
|
-
function escapeHtml(value) { return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """); }
|