fix: normalize poll providers and msteams deps
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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") {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user