mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-06 06:41:08 +00:00
fix(telegram): allow target approvals fallback
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
isTelegramExecApprovalApprover,
|
||||
isTelegramExecApprovalAuthorizedSender,
|
||||
isTelegramExecApprovalClientEnabled,
|
||||
isTelegramExecApprovalTargetRecipient,
|
||||
resolveTelegramExecApprovalTarget,
|
||||
shouldHandleTelegramExecApprovalRequest,
|
||||
} from "./exec-approvals.js";
|
||||
@@ -115,6 +116,9 @@ const resolveTelegramApproveCommandBehavior: NonNullable<
|
||||
if (isTelegramExecApprovalClientEnabled({ cfg, accountId })) {
|
||||
return undefined;
|
||||
}
|
||||
if (isTelegramExecApprovalTargetRecipient({ cfg, accountId, senderId })) {
|
||||
return undefined;
|
||||
}
|
||||
if (
|
||||
isTelegramExecApprovalAuthorizedSender({ cfg, accountId, senderId }) &&
|
||||
!isTelegramExecApprovalApprover({ cfg, accountId, senderId })
|
||||
|
||||
@@ -499,6 +499,9 @@ const telegramCommandTestPlugin: ChannelPlugin = {
|
||||
if (isTelegramExecApprovalClientEnabled({ cfg, accountId })) {
|
||||
return undefined;
|
||||
}
|
||||
if (isTelegramExecApprovalTargetRecipient({ cfg, accountId, senderId })) {
|
||||
return undefined;
|
||||
}
|
||||
if (
|
||||
isTelegramExecApprovalAuthorizedSender({ cfg, accountId, senderId }) &&
|
||||
!getTelegramExecApprovalApprovers({ cfg, accountId }).includes(senderId?.trim() ?? "")
|
||||
|
||||
Reference in New Issue
Block a user