From d6256a388e4e31f29e7594ad93c0ca794b60fd15 Mon Sep 17 00:00:00 2001 From: Onur Date: Thu, 8 Jan 2026 10:49:12 +0300 Subject: [PATCH] feat(msteams): wire up proactive messaging in routeReply for queued replies --- src/auto-reply/reply/route-reply.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/auto-reply/reply/route-reply.ts b/src/auto-reply/reply/route-reply.ts index 909407e78..32f2b220b 100644 --- a/src/auto-reply/reply/route-reply.ts +++ b/src/auto-reply/reply/route-reply.ts @@ -10,6 +10,7 @@ import type { ClawdbotConfig } from "../../config/config.js"; import { sendMessageDiscord } from "../../discord/send.js"; import { sendMessageIMessage } from "../../imessage/send.js"; +import { sendMessageMSTeams } from "../../msteams/send.js"; import { sendMessageSignal } from "../../signal/send.js"; import { sendMessageSlack } from "../../slack/send.js"; import { sendMessageTelegram } from "../../telegram/send.js"; @@ -54,7 +55,8 @@ export type RouteReplyResult = { export async function routeReply( params: RouteReplyParams, ): Promise { - 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` const text = payload.text ?? ""; @@ -146,11 +148,13 @@ export async function routeReply( } case "msteams": { - // TODO: Implement proactive messaging for MS Teams - return { - ok: false, - error: `MS Teams routing not yet supported for queued replies`, - }; + const result = await sendMessageMSTeams({ + cfg, + to, + text, + mediaUrl, + }); + return { ok: true, messageId: result.messageId }; } default: { @@ -203,7 +207,8 @@ export function isRoutableChannel( | "discord" | "signal" | "imessage" - | "whatsapp" { + | "whatsapp" + | "msteams" { if (!channel) return false; return [ "telegram", @@ -212,5 +217,6 @@ export function isRoutableChannel( "signal", "imessage", "whatsapp", + "msteams", ].includes(channel); }