fix: normalize poll providers and msteams deps

This commit is contained in:
Peter Steinberger
2026-01-09 10:05:33 +01:00
parent e55358c65d
commit 475d598ecb
3 changed files with 6 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ clawdbot message poll --provider msteams --to conversation:19:abc@thread.tacv2 \
```
Options:
- `--provider`: `whatsapp` (default) or `discord`
- `--provider`: `whatsapp` (default), `discord`, or `msteams`
- `--poll-multi`: allow selecting multiple options
- `--poll-duration-hours`: Discord-only (defaults to 24 when omitted)

View File

@@ -283,6 +283,8 @@ export async function messageCommand(
sendSlack: deps.sendMessageSlack,
sendSignal: deps.sendMessageSignal,
sendIMessage: deps.sendMessageIMessage,
sendMSTeams: (to, text, opts) =>
deps.sendMessageMSTeams({ cfg, to, text, mediaUrl: opts?.mediaUrl }),
};
if (opts.dryRun && action !== "send" && action !== "poll") {

View File

@@ -169,7 +169,7 @@ export async function sendMessage(
export async function sendPoll(
params: MessagePollParams,
): Promise<MessagePollResult> {
const provider = (params.provider ?? "whatsapp").toLowerCase();
const provider = normalizeMessageProvider(params.provider) ?? "whatsapp";
if (
provider !== "whatsapp" &&
provider !== "discord" &&
@@ -205,6 +205,8 @@ export async function sendPoll(
messageId: string;
toJid?: string;
channelId?: string;
conversationId?: string;
pollId?: string;
}>({
url: gateway.url,
token: gateway.token,