# 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: 1. **Click input box** at (1454, 1889) 2. **Verify/switch IME** to ADBKeyboard (WeChat auto-switches to com.tencent.wetype) 3. **Type text** via ADBKeyboard broadcast 4. **Screenshot + OCR** to find "发送" button location 5. **Click "发送"** at found location 6. **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: ```python # 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 method - `wechat-keyboard-auto-switch.md` - IME switching behavior - `wechat-split-screen-chat-list-vs-chat-ui.md` - Distinguishing chat list from chat UI