X (Twitter) DM Auto Chat (End-to-End) for Openclaw

An end-to-end AI agent skill designed to scan X (Twitter) DM inboxes, read conversation histories, and generate persona-based replies or conduct user outreach campaigns automatically via browser automation.

browseract-cli
v1.0.0
Jul 9, 2026
0
551
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install x-dm-auto-chat

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install x-dm-auto-chat using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is X (Twitter) DM Auto Chat (End-to-End)?

The X (Twitter) DM Auto Chat skill is a robust automation component built to streamline private message interactions on X. By merging API metadata with DOM parsing, the skill allows an AI agent to handle the entire lifecycle of direct messaging—from refreshing the inbox and identifying pending replies to reading conversation threads, applying predefined personas, and securely transmitting text-only responses through Chrome DevTools Protocol (CDP) real keyboard events.

This workflow brings programmatic execution to manual browser tasks, making it a powerful addition to your collection of Openclaw Skills. It ensures full alignment with user authentication states, handling built-in features like E2E passcode unlocking, DM permission filtering (such as distinguishing between Allowed and InboxClosed statuses), and rate control to safely emulate human cadence without risking anti-abuse or spam detection flags.

X (Twitter) DM Auto Chat (End-to-End) Use Cases

  • Automated Customer Support: Scan your X inbox continuously to identify unread DMs from customers and answer instantly using a friendly community manager persona.
  • Twitter Outbound Campaigns: Search for targeted content creators or industry users, filter for active DM permissions, and automatically initiate personalized first-contact outreach messages.
  • Persona-Driven Engagement: Maintain an active private messaging presence using customized brand tones, ensuring all pending replies are processed while maintaining a strictly serial, human-like delay configuration.
  • Secure Message Requests Handling: Automatically route new non-follower messages into user streams, enabling a highly organized approach to scalable networking.

How X (Twitter) DM Auto Chat (End-to-End) Works

  1. Login and State Verification: The skill scans active browser instances to locate an authenticated x.com session, automatically resolving the target browser ID.
  2. Passcode Unlock: If end-to-end encryption is enabled, the workflow locates the 4-digit passcode input fields and applies real CDP keyboard events to unlock the DOM data.
  3. Inbox Scanning: Merges API metadata and DOM previews via a Python script to build a structured snapshot of unread and pending-reply conversations.
  4. Context Retrieval: Navigates to individual conversation URLs serially, scrolls to load past message history, and parses the text context.
  5. AI Intervention and Send: The calling agent uses the history and persona string to draft a reply, types it securely via browser emulation, clicks the send button, and verifies execution via script checkpoints.

X (Twitter) DM Auto Chat (End-to-End) Setup

Ensure your X account is logged into the browser with the account menu visible on x.com before initiating. Provide your persona description and the 4-digit DM passcode (if E2E encryption is enabled) to the calling agent.

Execute the skill within your agent's ecosystem to verify tool readiness:

browser-act browser list
python scripts/check-page-state.py

X (Twitter) DM Auto Chat (End-to-End) Data Schema & Taxonomy

The skill interfaces with underlying Python execution scripts to ingest and output structured JSON payloads. Below is the main taxonomy for scanned inbox metadata items:

Field Name Type Description
conversation_id String Unique colon-separated identifier for the chat channel.
peer_screen_name String The X handle of the target conversation participant.
unread Boolean Flags whether there are unread messages requiring attention.
peer_can_dm_reason String Evaluation status, such as 'Allowed' or 'InboxClosed'.

All execution tracking, breakpoints, and history logs are maintained externally by the caller using standard JSONL lines to ensure session recovery.

X (Twitter) DM Auto Chat (End-to-End) Advanced Features

  • CDP Keyboard Emulation: Bypasses traditional JavaScript value insertion by generating native browser keyboard events to unlock passcodes and input text, ensuring high compatibility with X anti-bot layers.
  • Anti-Abuse Rate Control: Integrates random jitter delays (ranging from 8 to 20 seconds) between actions to strictly limit throughput to safe limits.
  • Breakpoint Resumption: Leverages structured JSONL logging to record per-item statuses, preventing accidental duplicate sends and allowing seamless recovery during interruptions.
  • Dynamic Browser Routing: Automatically discovers, connects, and locks onto the active X browser session without requiring hardcoded session details.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*