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:
|
Options:
|
||||||
- `--provider`: `whatsapp` (default) or `discord`
|
- `--provider`: `whatsapp` (default), `discord`, or `msteams`
|
||||||
- `--poll-multi`: allow selecting multiple options
|
- `--poll-multi`: allow selecting multiple options
|
||||||
- `--poll-duration-hours`: Discord-only (defaults to 24 when omitted)
|
- `--poll-duration-hours`: Discord-only (defaults to 24 when omitted)
|
||||||
|
|
||||||
|
|||||||
@@ -283,6 +283,8 @@ export async function messageCommand(
|
|||||||
sendSlack: deps.sendMessageSlack,
|
sendSlack: deps.sendMessageSlack,
|
||||||
sendSignal: deps.sendMessageSignal,
|
sendSignal: deps.sendMessageSignal,
|
||||||
sendIMessage: deps.sendMessageIMessage,
|
sendIMessage: deps.sendMessageIMessage,
|
||||||
|
sendMSTeams: (to, text, opts) =>
|
||||||
|
deps.sendMessageMSTeams({ cfg, to, text, mediaUrl: opts?.mediaUrl }),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (opts.dryRun && action !== "send" && action !== "poll") {
|
if (opts.dryRun && action !== "send" && action !== "poll") {
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ export async function sendMessage(
|
|||||||
export async function sendPoll(
|
export async function sendPoll(
|
||||||
params: MessagePollParams,
|
params: MessagePollParams,
|
||||||
): Promise<MessagePollResult> {
|
): Promise<MessagePollResult> {
|
||||||
const provider = (params.provider ?? "whatsapp").toLowerCase();
|
const provider = normalizeMessageProvider(params.provider) ?? "whatsapp";
|
||||||
if (
|
if (
|
||||||
provider !== "whatsapp" &&
|
provider !== "whatsapp" &&
|
||||||
provider !== "discord" &&
|
provider !== "discord" &&
|
||||||
@@ -205,6 +205,8 @@ export async function sendPoll(
|
|||||||
messageId: string;
|
messageId: string;
|
||||||
toJid?: string;
|
toJid?: string;
|
||||||
channelId?: string;
|
channelId?: string;
|
||||||
|
conversationId?: string;
|
||||||
|
pollId?: string;
|
||||||
}>({
|
}>({
|
||||||
url: gateway.url,
|
url: gateway.url,
|
||||||
token: gateway.token,
|
token: gateway.token,
|
||||||
|
|||||||
Reference in New Issue
Block a user