mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 07:02:44 +00:00
fix: use per-account action config for Discord and Telegram gating
listActions now unions gates across all enabled accounts (matching the Signal pattern), and handleDiscordAction/handleTelegramAction resolve through the per-account merged config instead of reading only the top-level channel actions object. This lets account-specific moderation/sticker/presence overrides take effect at both listing and execution time.
This commit is contained in:
committed by
Peter Steinberger
parent
1faf8e8e9d
commit
a03fec2a3f
@@ -1,5 +1,6 @@
|
||||
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 {
|
||||
resolveTelegramInlineButtonsScope,
|
||||
@@ -87,7 +88,8 @@ export async function handleTelegramAction(
|
||||
): Promise<AgentToolResult<unknown>> {
|
||||
const action = readStringParam(params, "action", { required: true });
|
||||
const accountId = readStringParam(params, "accountId");
|
||||
const isActionEnabled = createActionGate(cfg.channels?.telegram?.actions);
|
||||
const account = resolveTelegramAccount({ cfg, accountId });
|
||||
const isActionEnabled = createActionGate(account.config.actions);
|
||||
|
||||
if (action === "react") {
|
||||
// Check reaction level first
|
||||
|
||||
Reference in New Issue
Block a user