fix(telegram): wire delete action for message tool (#903) - thanks @sleontenko

Co-authored-by: Stan <sleontenko@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-01-15 00:29:28 +00:00
parent 83a25d26fc
commit 0d0b77ded6
6 changed files with 56 additions and 6 deletions

View File

@@ -1,4 +1,8 @@
import { createActionGate, readStringParam } from "../../../agents/tools/common.js";
import {
createActionGate,
readStringOrNumberParam,
readStringParam,
} from "../../../agents/tools/common.js";
import { handleTelegramAction } from "../../../agents/tools/telegram-actions.js";
import type { ClawdbotConfig } from "../../../config/config.js";
import { listEnabledTelegramAccounts } from "../../../telegram/accounts.js";
@@ -94,7 +98,10 @@ export const telegramMessageActions: ChannelMessageActionAdapter = {
}
if (action === "delete") {
const chatId = readStringParam(params, "chatId", { required: true });
const chatId =
readStringOrNumberParam(params, "chatId") ??
readStringOrNumberParam(params, "channelId") ??
readStringParam(params, "to", { required: true });
const messageId = readStringParam(params, "messageId", {
required: true,
});