Send Douyin DMs, reply, and check chat history through browser automation. 自动发送抖音私信、回复消息、查看聊天记录。
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install douyin-messager或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install douyin-messager⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/douyin-messager/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: Douyin Messager | 抖音私信助手 description: "Send Douyin DMs, reply, and check chat history through browser automation. 自动发送抖音私信、回复消息、查看聊天记录。" ---
通过浏览器自动化发送抖音私信、获取聊天记录。
xdg-open 弹窗:只在 Linux 下存在,Windows/macOS 不需要检查。
shell=powershell 或 os=Windows_NT,跳过 xdg-open 检查shell=bash,询问用户是否关闭了弹窗---
browser action=open profile=openclaw targetUrl=https://www.douyin.com/
browser action=act request={"kind": "wait", "timeMs": 2000}
方式 A:置顶联系人(最快)
方式 B:搜索用户(普适)
> 注意:私信面板是动态浮层,每次快照后元素 ref 会变化。优先用 JS evaluate 定位元素,少用 ref 点击。
私信输入框是 Draft.js 富文本编辑器(contenteditable),不是普通 input,不能用 type 指令直接操作。
第一步:找到编辑器
browser action=act request={"kind": "evaluate", "fn": "() => { const all = document.querySelectorAll('*'); let panel = null; for (const el of all) { const r = el.getBoundingClientRect(); if (r.width >= 300 && r.width <= 400 && r.height >= 400 && r.height <= 700 && r.left >= 870 && r.left <= 1010) { if (el.textContent.includes('<目标用户名>') && el.textContent.includes('发送消息')) { panel = el; break; } } } if (!panel) return 'panel not found'; const editor = panel.querySelector('.public-DraftEditor-content'); if (!editor) return 'editor not found'; return 'found'; }"}
如果返回 panel not found,说明私信面板未打开,重新执行步骤 2。
第二步:用剪贴板粘贴(绕过 Draft.js 事件拦截)
browser action=act request={"kind": "evaluate", "fn": "() => { const editor = document.querySelector('.public-DraftEditor-content'); if (!editor) return 'editor not found'; (editor.parentElement || editor).focus(); navigator.clipboard.writeText('消息内容').then(() => document.execCommand('paste')); return 'ok'; }"}
browser action=act request={"kind": "wait", "timeMs": 300}
第三步:确认已写入
browser action=act request={"kind": "evaluate", "fn": "() => { const editor = document.querySelector('.public-DraftEditor-content'); if (!editor) return 'editor not found'; return editor.textContent.includes('消息内容') ? 'ok' : 'not written'; }"}
第四步:发送(Enter 键)
browser action=act request={"kind": "evaluate", "fn": "() => { const editor = document.querySelector('.public-DraftEditor-content'); if (!editor) return 'editor not found'; editor.dispatchEvent(new KeyboardEvent('keydown', {key: 'Enter', code: 'Enter', keyCode: 13, which: 13, bubbles: true})); return 'sent'; }"}
browser action=act request={"kind": "wait", "timeMs": 1000}
获取快照,检查私信列表中是否出现 消息内容 · 刚刚。
---
browser action=act request={"kind": "evaluate", "fn": "() => { const panel = document.querySelector('[class*=\"w5duGc5Q\"], [class*=\"RoMuFUzT\"]'); if (!panel) return 'panel not found'; panel.scrollTop = panel.scrollHeight; return 'scrolled'; }"}
browser action=screenshot
新消息气泡在可视区域底部之外,先滚动再截图。
---
# 1. 打开抖音
browser action=open profile=openclaw targetUrl=https://www.douyin.com/
browser action=act request={"kind": "wait", "timeMs": 2000}
# 2. 打开私信面板(JS 点击私信按钮)
browser action=act request={"kind": "evaluate", "fn": "() => { const all = document.querySelectorAll('*'); for (const el of all) { if ((el.textContent || '').trim() === '私信' && el.getBoundingClientRect().width < 100) { el.click(); return 'clicked'; } } return 'not found'; }"}
browser action=act request={"kind": "wait", "timeMs": 800}
# 3. 在私信列表中点击目标
browser action=act request={"kind": "evaluate", "fn": "() => { const all = document.querySelectorAll('[class*=\"w5duGc5Q\"], [class*=\"RoMuFUzT\"]'); for (const p of all) { const r = p.getBoundingClientRect(); if (r.width === 500 && Math.abs(r.left - 1006) < 50) { const items = p.querySelectorAll('[class*=\"cursor-pointer\"]'); for (const item of items) { if ((item.textContent || '').includes('<目标用户名>')) { item.click(); return 'clicked target'; } } } } return 'not found'; }"}
browser action=act request={"kind": "wait", "timeMs": 800}
# 4. 粘贴消息
browser action=act request={"kind": "evaluate", "fn": "() => { const editor = document.querySelector('.public-DraftEditor-content'); if (!editor) return 'editor not found'; (editor.parentElement || editor).focus(); navigator.clipboard.writeText('你好').then(() => document.execCommand('paste')); return 'ok'; }"}
browser action=act request={"kind": "wait", "timeMs": 300}
# 5. 发送
browser action=act request={"kind": "evaluate", "fn": "() => { const editor = document.querySelector('.public-DraftEditor-content'); editor.dispatchEvent(new KeyboardEvent('keydown', {key: 'Enter', code: 'Enter', keyCode: 13, which: 13, bubbles: true})); return 'sent'; }"}
browser action=act request={"kind": "wait", "timeMs": 1000}
# 6. 确认
browser action=snapshot
---
# 1. 打开抖音
browser action=open profile=openclaw targetUrl=https://www.douyin.com/
browser action=act request={"kind": "wait", "timeMs": 2000}
# 2. 搜索目标用户名
browser action=act request={"kind": "evaluate", "fn": "() => { const input = document.querySelector('input[type=\"text\"]'); if (!input) return 'input not found'; input.focus(); input.value = '<目标用户名>'; input.dispatchEvent(new Event('input', {bubbles: true})); return 'typed'; }"}
browser action=act request={"kind": "evaluate", "fn": "() => { const btns = document.querySelectorAll('button'); for (const b of btns) { if ((b.textContent || '').includes('搜索')) { b.click(); return 'search clicked'; } } return 'not found'; }"}
browser action=act request={"kind": "wait", "timeMs": 2000}
# 3. 在结果中点击目标主页(选有"相互关注"标识的条目)
browser action=snapshot
# 找到目标条目后点击进入主页
# 4. 点击主页"私信"按钮
browser action=act request={"kind": "evaluate", "fn": "() => { const btns = document.querySelectorAll('button'); for (const b of btns) { if ((b.textContent || '').trim() === '私信') { b.click(); return 'clicked'; } } return 'not found'; }"}
browser action=act request={"kind": "wait", "timeMs": 800}
# 5. 粘贴 + 发送(与方式 A 相同)
browser action=act request={"kind": "evaluate", "fn": "() => { const editor = document.querySelector('.public-DraftEditor-content'); if (!editor) return 'editor not found'; (editor.parentElement || editor).focus(); navigator.clipboard.writeText('你好').then(() => document.execCommand('paste')); return 'ok'; }"}
browser action=act request={"kind": "wait", "timeMs": 300}
browser action=act request={"kind": "evaluate", "fn": "() => { const editor = document.querySelector('.public-DraftEditor-content'); editor.dispatchEvent(new KeyboardEvent('keydown', {key: 'Enter', code: 'Enter', keyCode: 13, which: 13, bubbles: true})); return 'sent'; }"}
browser action=act request={"kind": "wait", "timeMs": 1000}安装 Douyin Messager | 抖音私信助手 后,可以对 AI 说这些话来触发它
Send a Slack message to the #engineering channel about the deployment
Formats and sends the message with relevant context, tagging the right people
Summarize all unread messages in my inbox from today
Reads messages across connected channels and returns a prioritized summary
Draft a reply to this customer complaint and send it for review
Writes an empathetic, professional response and routes it to the approval queue
将技能文件夹放到 ~/.claude/skills/douyin-messager/ 目录(个人级,所有项目可用),或 .claude/skills/douyin-messager/(项目级)。重启 AI 客户端后,用 /douyin-messager 主动调用,或让 AI 根据上下文自动发现并使用。
Douyin Messager | 抖音私信助手 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Douyin Messager | 抖音私信助手 可免费安装使用。请查阅仓库了解许可证信息。
Send Douyin DMs, reply, and check chat history through browser automation. 自动发送抖音私信、回复消息、查看聊天记录。
Douyin Messager | 抖音私信助手 属于「Communication」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。