fix: allow media-only sends

This commit is contained in:
Peter Steinberger
2026-01-16 03:15:07 +00:00
parent f449115ec5
commit a0d2a7232e
15 changed files with 200 additions and 9 deletions

View File

@@ -130,8 +130,13 @@ export async function handleTelegramAction(
throw new Error("Telegram sendMessage is disabled.");
}
const to = readStringParam(params, "to", { required: true });
const content = readStringParam(params, "content", { required: true });
const mediaUrl = readStringParam(params, "mediaUrl");
// Allow content to be omitted when sending media-only (e.g., voice notes)
const content =
readStringParam(params, "content", {
required: !mediaUrl,
allowEmpty: true,
}) ?? "";
const buttons = readTelegramButtons(params);
if (buttons && !hasInlineButtonsCapability({ cfg, accountId: accountId ?? undefined })) {
throw new Error(