mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 05:07:38 +00:00
fix(actions): layer per-account gate fallback
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { AgentToolResult } from "@mariozechner/pi-agent-core";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { resolveTelegramAccount } from "../../telegram/accounts.js";
|
||||
import type { TelegramButtonStyle, TelegramInlineButtons } from "../../telegram/button-types.js";
|
||||
import { createTelegramActionGate } from "../../telegram/accounts.js";
|
||||
import {
|
||||
resolveTelegramInlineButtonsScope,
|
||||
resolveTelegramTargetChatType,
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
import { getCacheStats, searchStickers } from "../../telegram/sticker-cache.js";
|
||||
import { resolveTelegramToken } from "../../telegram/token.js";
|
||||
import {
|
||||
createActionGate,
|
||||
jsonResult,
|
||||
readNumberParam,
|
||||
readReactionParams,
|
||||
@@ -89,8 +88,7 @@ export async function handleTelegramAction(
|
||||
): Promise<AgentToolResult<unknown>> {
|
||||
const action = readStringParam(params, "action", { required: true });
|
||||
const accountId = readStringParam(params, "accountId");
|
||||
const account = resolveTelegramAccount({ cfg, accountId });
|
||||
const isActionEnabled = createActionGate(account.config.actions);
|
||||
const isActionEnabled = createTelegramActionGate({ cfg, accountId });
|
||||
|
||||
if (action === "react") {
|
||||
// Check reaction level first
|
||||
|
||||
Reference in New Issue
Block a user