Agent skill
direct-messages
Sends, manages, and automates direct messages on X/Twitter. Supports personalized bulk DMs with templates, conversation management, message request filtering, and DM export. The agent uses this skill when a user needs to send DMs, manage conversations, or automate direct messaging workflows.
Install this agent skill to your Project
npx add-skill https://github.com/nirholas/XActions/tree/main/skills/direct-messages
Metadata
Additional technical details for this skill
- author
- nichxbt
- version
- 3.0
SKILL.md
Direct Messages
Browser console scripts for sending, managing, and exporting X/Twitter DMs.
Available Scripts
| Script | File | Purpose |
|---|---|---|
| Send Direct Messages | src/sendDirectMessage.js |
Send personalized DMs to a list of users |
| DM Manager | src/dmManager.js |
Core DM management (read, filter, organize, export) |
Send Direct Messages
File: src/sendDirectMessage.js
Send personalized DMs to multiple users with message templates and rate limiting.
Configuration
const CONFIG = {
targetUsers: ['user1', 'user2'],
messageTemplate: 'Hey {username}! 👋 Just wanted to connect.',
limits: {
messagesPerSession: 10,
delayBetweenMessages: 30000,
},
skipIfAlreadyMessaged: true,
dryRun: true,
};
How to use
- Navigate to
x.com/messages - Edit CONFIG with target users and message template
- Set
dryRun: falsewhen ready - Open DevTools (F12) → Console
- Paste the script → Enter
Safety features
- Tracks sent messages in
localStorageto avoid duplicates - Configurable delay between messages (30s default)
- Session limit prevents over-messaging
- Dry-run mode previews actions without sending
Warning: Mass DMing can get your account restricted. Only message users who have open DMs or follow you.
DM Manager
File: src/dmManager.js
Core module for reading, filtering, organizing, and exporting DM conversations. Supports message requests, conversation search, and DM privacy settings.
How to use
- Navigate to
x.com/messages - Open DevTools (F12) → Console
- Paste the script → Enter
Key Selectors
| Element | Selector |
|---|---|
| New message button | [data-testid="NewDM_Button"] |
| Search people | [data-testid="searchPeople"] |
| Message input | [data-testid="dmComposerTextInput"] |
| Send button | [data-testid="dmComposerSendButton"] |
| Conversation list | [data-testid="conversation"] |
| Message bubble | [data-testid="messageEntry"] |
| Message requests | [data-testid="messageRequests"] |
| Back button | [data-testid="app-bar-back"] |
Notes
- DM scripts require being on the Messages page (
x.com/messages) - Group chats support up to 50 participants
- Message requests from non-followers must be approved before replying
- Add delays (30s+) between bulk DMs to avoid rate limits
{username}placeholder in templates is replaced with the recipient's handle- Sent history is persisted in
localStorageacross sessions
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
articles-longform
Compose, preview, publish, and manage long-form Articles on X/Twitter. Premium+ feature. Includes article creation, formatting, media insertion, and performance tracking. Use when users want to write, publish, manage, or analyze X Articles.
x-pro-management
Navigate to X Pro (TweetDeck), set up monitoring columns, and manage multi-column view. Use when users want to use X Pro / TweetDeck features or set up a multi-column dashboard.
business-ads
Manages X/Twitter business intelligence including brand monitoring, audience insights, competitor analysis, tweet A/B testing, auto-plug replies for promotion, and content performance optimization. Use when users want brand monitoring, audience analysis, competitor comparison, or promotion optimization on X.
engagement-interaction
Automates X/Twitter engagement actions — like, unlike, reply, bookmark, hide replies, and auto-like by keyword. Also bulk-unlikes all posts. Use when users want to automate likes, send replies, manage bookmarks on tweets, hide replies, or clear their entire likes history.
unfollow-management
Mass unfollow on X/Twitter via browser console scripts. Unfollows everyone, only non-followers, non-followers with username logging, smart time-based unfollow with whitelists, and follow/following ratio management. Use when cleaning up a following list, removing non-followers, bulk unfollowing accounts, or optimizing your follow ratio.
follower-monitoring
Monitors X/Twitter follower changes using browser console scripts. Detects who unfollowed, tracks new followers with welcome messages, monitors any public account, runs continuous monitoring with alerts, tracks follower growth over time, and analyzes follower demographics. Use when tracking follower changes, detecting unfollowers, or monitoring Twitter accounts.
Didn't find tool you were looking for?