fix: align telegram token resolution

This commit is contained in:
Peter Steinberger
2026-01-01 21:22:59 +01:00
parent e0043906be
commit c7364de2f0
13 changed files with 278 additions and 72 deletions

View File

@@ -1,7 +1,9 @@
import type { CliDeps } from "../cli/deps.js";
import { loadConfig } from "../config/config.js";
import { callGateway, randomIdempotencyKey } from "../gateway/call.js";
import { success } from "../globals.js";
import type { RuntimeEnv } from "../runtime.js";
import { resolveTelegramToken } from "../telegram/token.js";
export async function sendCommand(
opts: {
@@ -25,8 +27,9 @@ export async function sendCommand(
}
if (provider === "telegram") {
const { token } = resolveTelegramToken(loadConfig());
const result = await deps.sendMessageTelegram(opts.to, opts.message, {
token: process.env.TELEGRAM_BOT_TOKEN,
token: token || undefined,
mediaUrl: opts.media,
});
runtime.log(