blun-king-cli 9.1.640 → 9.1.642
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/CHANGELOG.md +21 -0
- package/bin/blun.js +0 -0
- package/bin/core-bootstrap.js +0 -0
- package/bin/king.js +0 -0
- package/bin/launcher-mode.js +0 -0
- package/bin/launcher-runtime.js +0 -0
- package/bin/managed-node.js +0 -0
- package/bin/native-command-runner.js +0 -0
- package/bin/native-module-repair.js +0 -0
- package/bin/node-runtime.js +0 -0
- package/bin/node-version.js +0 -0
- package/bin/plugin-bootstrap.js +0 -0
- package/bin/private-paths.js +0 -0
- package/bin/standard-tools-bootstrap.js +0 -0
- package/bin/update-copy.js +0 -0
- package/bin/update-lease.js +0 -0
- package/bin/update-notice.js +0 -0
- package/blun.mjs +1232 -142
- package/package.json +1 -1
- package/telegram-plugin/dist/bridge.mjs +8 -0
- package/worker-host.mjs +300 -60
package/package.json
CHANGED
|
@@ -68438,6 +68438,12 @@ function alreadySeen(key) {
|
|
|
68438
68438
|
}
|
|
68439
68439
|
const MAX_INBOUND_AGE_S = Number(process.env.BLUN_TELEGRAM_MAX_INBOUND_AGE_S ?? 900);
|
|
68440
68440
|
const HEADLESS_ENABLED = (process.env.BLUN_TELEGRAM_HEADLESS ?? "on").trim().toLowerCase() !== "off";
|
|
68441
|
+
function controlAuthorized(ctx, result) {
|
|
68442
|
+
if (result.action !== "deliver" || result.addressed === false || result.inferAddressing === true || ctx.from === void 0 || ctx.from.isBot === true || ctx.chatId === void 0) return false;
|
|
68443
|
+
const id = String(ctx.from.id);
|
|
68444
|
+
const group = result.access.groups[String(ctx.chatId)];
|
|
68445
|
+
return result.access.allowFrom.includes(id) || (group?.allowFrom ?? []).includes(id) || (group?.alwaysAllowFrom ?? []).includes(id);
|
|
68446
|
+
}
|
|
68441
68447
|
async function handleInbound(event) {
|
|
68442
68448
|
const { ctx } = event;
|
|
68443
68449
|
const result = gate(ctx, botUsername);
|
|
@@ -68478,6 +68484,8 @@ async function handleInbound(event) {
|
|
|
68478
68484
|
addressed: inferAddressing ? "semantic" : String(addressed),
|
|
68479
68485
|
user: ctx.from?.username ?? String(ctx.from?.id),
|
|
68480
68486
|
user_id: String(ctx.from?.id),
|
|
68487
|
+
bot_username: bot.botInfo.username,
|
|
68488
|
+
control_authorized: String(controlAuthorized(ctx, result)),
|
|
68481
68489
|
ts: (/* @__PURE__ */ new Date((ctx.date ?? 0) * 1e3)).toISOString(),
|
|
68482
68490
|
...image !== void 0 ? { image_path: image.path } : {},
|
|
68483
68491
|
...attachment !== void 0 ? {
|