wechat-send-message-mechanism.md
2.18 KB
WeChat Send Message Mechanism
Discovery Date: 2026-06-25
Core Mechanism
WeChat's chat UI has a dynamic bottom button that changes based on input state:
Empty Input State
- Bottom button shows "+" (plus icon)
- Function: Opens attachment menu (image, video, location, etc.)
- Location: approximately (1500, 1601) on inner_split_right
Text Input State
- Bottom button changes to "发送" (Send)
- Function: Sends the typed message
- Location: (1979, 1887) on inner_split_right
- Only appears after text is typed
Critical Sequence
The correct send sequence is:
- Click input box at (1454, 1889)
- Verify/switch IME to ADBKeyboard (WeChat auto-switches to com.tencent.wetype)
- Type text via ADBKeyboard broadcast
- Screenshot + OCR to find "发送" button location
- Click "发送" at found location
- Verify via database query (get_wechat_messages)
Common Mistakes
Mistake 1: Looking for "发送" before typing
- Wrong: Screenshot → OCR for "发送" → not found → assume failure
- Right: Type text first → then screenshot → OCR finds "发送"
Mistake 2: Clicking "+" thinking it's "发送"
- Wrong: Click bottom button when input is empty → opens attachment menu
- Right: Only click bottom button after typing text
Mistake 3: Assuming fixed coordinates
- Wrong: Hardcode "发送" at (1979, 1887) without verification
- Right: OCR to find "发送" after each text input (position may vary)
Verified Coordinates (inner_split_right)
| Element | Coordinates | When |
|---|---|---|
| Input box | (1454, 1889) | Keyboard active, text entered |
| "+" button | ~1500, 1601 | Input empty |
| "发送" button | (1979, 1887) | After text input |
Database Verification
After sending, always verify via database:
# Query WeChat messages for contact
messages = get_wechat_messages(contact="火星人", limit=5)
# Check if sent message appears in results
Related References
wechat-chat-input-coordinates.md- Input box discovery methodwechat-keyboard-auto-switch.md- IME switching behaviorwechat-split-screen-chat-list-vs-chat-ui.md- Distinguishing chat list from chat UI