fix: clarify WhatsApp owner number prompts
This commit is contained in:
@@ -541,8 +541,12 @@ async function promptWhatsAppAllowFrom(
|
||||
const existingResponsePrefix = cfg.messages?.responsePrefix;
|
||||
|
||||
if (options?.forceAllowlist) {
|
||||
await prompter.note(
|
||||
"We need the sender/owner number so Clawdbot can allowlist you.",
|
||||
"WhatsApp number",
|
||||
);
|
||||
const entry = await prompter.text({
|
||||
message: "Your WhatsApp number (E.164)",
|
||||
message: "Your personal WhatsApp number (the phone you will message from)",
|
||||
placeholder: "+15555550123",
|
||||
initialValue: existingAllowFrom[0],
|
||||
validate: (value) => {
|
||||
@@ -604,8 +608,12 @@ async function promptWhatsAppAllowFrom(
|
||||
})) as "personal" | "separate";
|
||||
|
||||
if (phoneMode === "personal") {
|
||||
await prompter.note(
|
||||
"We need the sender/owner number so Clawdbot can allowlist you.",
|
||||
"WhatsApp number",
|
||||
);
|
||||
const entry = await prompter.text({
|
||||
message: "Your WhatsApp number (E.164)",
|
||||
message: "Your personal WhatsApp number (the phone you will message from)",
|
||||
placeholder: "+15555550123",
|
||||
initialValue: existingAllowFrom[0],
|
||||
validate: (value) => {
|
||||
|
||||
@@ -26,7 +26,7 @@ describe("buildPairingReply", () => {
|
||||
},
|
||||
{
|
||||
provider: "whatsapp",
|
||||
idLine: "Your WhatsApp sender id: +15550003333",
|
||||
idLine: "Your WhatsApp phone number: +15550003333",
|
||||
code: "MNO345",
|
||||
},
|
||||
] as const;
|
||||
|
||||
@@ -313,7 +313,7 @@ export async function monitorWebInbox(options: {
|
||||
await sock.sendMessage(remoteJid, {
|
||||
text: buildPairingReply({
|
||||
provider: "whatsapp",
|
||||
idLine: `Your WhatsApp sender id: ${candidate}`,
|
||||
idLine: `Your WhatsApp phone number: ${candidate}`,
|
||||
code,
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -671,7 +671,7 @@ describe("web monitor inbox", () => {
|
||||
expect(sock.readMessages).not.toHaveBeenCalled();
|
||||
expect(sock.sendMessage).toHaveBeenCalledTimes(1);
|
||||
expect(sock.sendMessage).toHaveBeenCalledWith("999@s.whatsapp.net", {
|
||||
text: expect.stringContaining("Your WhatsApp sender id: +999"),
|
||||
text: expect.stringContaining("Your WhatsApp phone number: +999"),
|
||||
});
|
||||
expect(sock.sendMessage).toHaveBeenCalledWith("999@s.whatsapp.net", {
|
||||
text: expect.stringContaining("Pairing code: PAIRCODE"),
|
||||
@@ -1125,7 +1125,7 @@ describe("web monitor inbox", () => {
|
||||
expect(onMessage).not.toHaveBeenCalled();
|
||||
expect(sock.sendMessage).toHaveBeenCalledTimes(1);
|
||||
expect(sock.sendMessage).toHaveBeenCalledWith("999@s.whatsapp.net", {
|
||||
text: expect.stringContaining("Your WhatsApp sender id: +999"),
|
||||
text: expect.stringContaining("Your WhatsApp phone number: +999"),
|
||||
});
|
||||
expect(sock.sendMessage).toHaveBeenCalledWith("999@s.whatsapp.net", {
|
||||
text: expect.stringContaining("Pairing code: PAIRCODE"),
|
||||
@@ -1281,7 +1281,7 @@ describe("web monitor inbox", () => {
|
||||
expect(onMessage).not.toHaveBeenCalled();
|
||||
expect(upsertPairingRequestMock).toHaveBeenCalledTimes(1);
|
||||
expect(sock.sendMessage).toHaveBeenCalledWith("999@s.whatsapp.net", {
|
||||
text: expect.stringContaining("Your WhatsApp sender id: +999"),
|
||||
text: expect.stringContaining("Your WhatsApp phone number: +999"),
|
||||
});
|
||||
expect(sock.sendMessage).toHaveBeenCalledWith("999@s.whatsapp.net", {
|
||||
text: expect.stringContaining("Pairing code: PAIRCODE"),
|
||||
|
||||
Reference in New Issue
Block a user