fix(whatsapp): use sender's JID for DM-with-bot registration, skip trigger (#751)

Two bugs in the DM with dedicated bot number setup:

1. The skill asked for the bot's own phone number to use as the JID.
   But from the bot's perspective, incoming DMs appear with the SENDER's
   JID (the user's personal number), not the bot's own number. The
   registration must use the user's personal number as the JID.

2. DM with bot (1:1 conversation) should use --no-trigger-required, same
   as self-chat. A trigger prefix is unnecessary in a private DM.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
glifocat
2026-03-08 18:58:48 +01:00
committed by GitHub
parent cfabdd816b
commit 5b2bafd7bb

View File

@@ -201,7 +201,11 @@ AskUserQuestion: Where do you want to chat with the assistant?
node -e "const c=JSON.parse(require('fs').readFileSync('store/auth/creds.json','utf-8'));console.log(c.me?.id?.split(':')[0]+'@s.whatsapp.net')" node -e "const c=JSON.parse(require('fs').readFileSync('store/auth/creds.json','utf-8'));console.log(c.me?.id?.split(':')[0]+'@s.whatsapp.net')"
``` ```
**DM with bot:** Ask for the bot's phone number. JID = `NUMBER@s.whatsapp.net` **DM with bot:** The JID is the **user's** phone number — the number they will message *from* (not the bot's own number). Ask:
AskUserQuestion: What is your personal phone number? (The number you'll use to message the bot — include country code without +, e.g. 1234567890)
JID = `<user-number>@s.whatsapp.net`
**Group (solo, existing):** Run group sync and list available groups: **Group (solo, existing):** Run group sync and list available groups:
@@ -223,7 +227,7 @@ npx tsx setup/index.ts --step register \
--channel whatsapp \ --channel whatsapp \
--assistant-name "<name>" \ --assistant-name "<name>" \
--is-main \ --is-main \
--no-trigger-required # Only for main/self-chat --no-trigger-required # For self-chat and DM with bot (1:1 conversations don't need a trigger prefix)
``` ```
For additional groups (trigger-required): For additional groups (trigger-required):