feat(msteams): wire up proactive messaging in routeReply for queued replies

This commit is contained in:
Onur
2026-01-08 10:49:12 +03:00
committed by Peter Steinberger
parent 04b1eb57eb
commit d6256a388e

View File

@@ -10,6 +10,7 @@
import type { ClawdbotConfig } from "../../config/config.js"; import type { ClawdbotConfig } from "../../config/config.js";
import { sendMessageDiscord } from "../../discord/send.js"; import { sendMessageDiscord } from "../../discord/send.js";
import { sendMessageIMessage } from "../../imessage/send.js"; import { sendMessageIMessage } from "../../imessage/send.js";
import { sendMessageMSTeams } from "../../msteams/send.js";
import { sendMessageSignal } from "../../signal/send.js"; import { sendMessageSignal } from "../../signal/send.js";
import { sendMessageSlack } from "../../slack/send.js"; import { sendMessageSlack } from "../../slack/send.js";
import { sendMessageTelegram } from "../../telegram/send.js"; import { sendMessageTelegram } from "../../telegram/send.js";
@@ -54,7 +55,8 @@ export type RouteReplyResult = {
export async function routeReply( export async function routeReply(
params: RouteReplyParams, params: RouteReplyParams,
): Promise<RouteReplyResult> { ): Promise<RouteReplyResult> {
const { payload, channel, to, accountId, threadId, abortSignal } = params; const { payload, channel, to, accountId, threadId, cfg, abortSignal } =
params;
// Debug: `pnpm test src/auto-reply/reply/route-reply.test.ts` // Debug: `pnpm test src/auto-reply/reply/route-reply.test.ts`
const text = payload.text ?? ""; const text = payload.text ?? "";
@@ -146,11 +148,13 @@ export async function routeReply(
} }
case "msteams": { case "msteams": {
// TODO: Implement proactive messaging for MS Teams const result = await sendMessageMSTeams({
return { cfg,
ok: false, to,
error: `MS Teams routing not yet supported for queued replies`, text,
}; mediaUrl,
});
return { ok: true, messageId: result.messageId };
} }
default: { default: {
@@ -203,7 +207,8 @@ export function isRoutableChannel(
| "discord" | "discord"
| "signal" | "signal"
| "imessage" | "imessage"
| "whatsapp" { | "whatsapp"
| "msteams" {
if (!channel) return false; if (!channel) return false;
return [ return [
"telegram", "telegram",
@@ -212,5 +217,6 @@ export function isRoutableChannel(
"signal", "signal",
"imessage", "imessage",
"whatsapp", "whatsapp",
"msteams",
].includes(channel); ].includes(channel);
} }