messenger

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Facebook Messenger Skill

Facebook Messenger Skill

Overview

概述

Automates Facebook Messenger interactions including messaging, group chats, reactions, and media sharing through the web interface at messenger.com.
通过messenger.com网页界面自动化Facebook Messenger交互,包括消息发送、群聊、表情反应和媒体分享。

Quick Install

快速安装

bash
curl -sSL https://canifi.com/skills/messenger/install.sh | bash
Or manually:
bash
cp -r skills/messenger ~/.canifi/skills/
bash
curl -sSL https://canifi.com/skills/messenger/install.sh | bash
或手动安装:
bash
cp -r skills/messenger ~/.canifi/skills/

Setup

设置

Configure via canifi-env:
bash
undefined
通过canifi-env进行配置:
bash
undefined

First, ensure canifi-env is installed:

First, ensure canifi-env is installed:

canifi-env set FACEBOOK_EMAIL "your-email@example.com" canifi-env set FACEBOOK_PASSWORD "your-password"
undefined
canifi-env set FACEBOOK_EMAIL "your-email@example.com" canifi-env set FACEBOOK_PASSWORD "your-password"
undefined

Privacy & Authentication

隐私与认证

Your credentials, your choice. Canifi LifeOS respects your privacy.
你的凭据,由你掌控。 Canifi LifeOS尊重你的隐私。

Option 1: Manual Browser Login (Recommended)

选项1:手动浏览器登录(推荐)

If you prefer not to share credentials with Claude Code:
  1. Complete the Browser Automation Setup using CDP mode
  2. Login to the service manually in the Playwright-controlled Chrome window
  3. Claude will use your authenticated session without ever seeing your password
如果你不想与Claude Code共享凭据:
  1. 使用CDP模式完成浏览器自动化设置
  2. 在Playwright控制的Chrome窗口中手动登录该服务
  3. Claude将使用你的已认证会话,且绝不会看到你的密码

Option 2: Environment Variables

选项2:环境变量

If you're comfortable sharing credentials, you can store them locally:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"
Note: Credentials stored in canifi-env are only accessible locally on your machine and are never transmitted.
如果你愿意共享凭据,可以将其存储在本地:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"
注意:存储在canifi-env中的凭据仅能在你的本地机器上访问,绝不会被传输。

Capabilities

功能

  • Send and receive messages
  • Create and manage group chats
  • Share photos, videos, and files
  • React to messages with emojis
  • Search conversations and contacts
  • Manage message requests
  • Handle video and voice calls (initiate only)
  • Create polls and events in chats
  • 发送和接收消息
  • 创建和管理群聊
  • 分享照片、视频和文件
  • 用表情符号对消息做出反应
  • 搜索对话和联系人
  • 管理消息请求
  • 处理视频和语音通话(仅支持发起)
  • 在聊天中创建投票和活动

Usage Examples

使用示例

Example 1: Send a Message

示例1:发送消息

User: "Message Lisa on Messenger asking if she's free this weekend"
Claude: I'll send that message on Messenger.
- Navigate to messenger.com
- Search for Lisa in contacts
- Open conversation
- Send: "Hey Lisa, are you free this weekend?"
- Confirm message sent
User: "Message Lisa on Messenger asking if she's free this weekend"
Claude: 我会在Messenger上发送这条消息。
- 导航至messenger.com
- 在联系人中搜索Lisa
- 打开对话
- 发送:"Hey Lisa, are you free this weekend?"
- 确认消息已发送

Example 2: Create a Group Chat

示例2:创建群聊

User: "Create a Messenger group with Tom, Amy, and Jake for the party planning"
Claude: I'll create that group chat.
- Click new message
- Add Tom, Amy, and Jake
- Name group "Party Planning"
- Send initial message
- Confirm group created
User: "Create a Messenger group with Tom, Amy, and Jake for the party planning"
Claude: 我会创建这个群聊。
- 点击新建消息
- 添加Tom、Amy和Jake
- 将群命名为"Party Planning"
- 发送初始消息
- 确认群聊已创建

Example 3: React to Messages

示例3:对消息做出反应

User: "React with a heart to the last message from Mom"
Claude: I'll add that reaction.
- Open conversation with Mom
- Find most recent message
- Add heart reaction
- Confirm reaction added
User: "React with a heart to the last message from Mom"
Claude: 我会添加这个反应。
- 打开与妈妈的对话
- 找到最新消息
- 添加心形反应
- 确认反应已添加

Example 4: Search Conversations

示例4:搜索对话

User: "Find messages about the concert tickets in Messenger"
Claude: I'll search your conversations.
- Open Messenger search
- Search "concert tickets"
- Collect matching messages
- Present results with context
User: "Find messages about the concert tickets in Messenger"
Claude: 我会搜索你的对话。
- 打开Messenger搜索
- 搜索"concert tickets"
- 收集匹配的消息
- 附带上下文展示结果

Authentication Flow

认证流程

  1. Navigate to messenger.com via Playwright MCP
  2. Enter Facebook credentials from canifi-env
  3. Handle 2FA if enabled (notify user via iMessage)
  4. Approve device if prompted
  5. Verify chat list loads
  6. Maintain session cookies
  1. 通过Playwright MCP导航至messenger.com
  2. 从canifi-env中输入Facebook凭据
  3. 若启用了双重认证(2FA)则进行处理(通过iMessage通知用户)
  4. 若提示则批准设备
  5. 验证聊天列表已加载
  6. 维护会话Cookie

Error Handling

错误处理

  • Login Failed: Clear cookies, retry with fresh session
  • Session Expired: Re-authenticate automatically
  • 2FA Required: iMessage notification for code
  • Account Locked: Notify user to verify identity
  • Contact Not Found: Search by name variations
  • Message Failed: Retry sending, check connection
  • Rate Limited: Wait before retrying operations
  • Device Approval: Notify user to check email/phone
  • 登录失败:清除Cookie,使用新会话重试
  • 会话过期:自动重新认证
  • 需要2FA:通过iMessage通知用户获取验证码
  • 账户锁定:通知用户验证身份
  • 未找到联系人:尝试不同的姓名变体进行搜索
  • 消息发送失败:重试发送,检查连接
  • 速率限制:等待后再重试操作
  • 设备批准:通知用户检查邮箱/电话

Self-Improvement Instructions

自我改进说明

When encountering new Messenger features:
  1. Document new UI elements and patterns
  2. Add support for new message types
  3. Log successful group management operations
  4. Update for new reactions and features
当遇到Messenger新功能时:
  1. 记录新的UI元素和模式
  2. 添加对新消息类型的支持
  3. 记录成功的群组管理操作
  4. 针对新的表情反应和功能进行更新

Notes

注意事项

  • Messenger shares login with Facebook
  • Some features require Facebook app approval
  • Message requests from non-friends go to separate folder
  • End-to-end encryption available for secret conversations
  • Video/audio calls cannot be fully automated
  • Business accounts have different features
  • Messenger Rooms have separate functionality
  • Messenger与Facebook共享登录状态
  • 部分功能需要Facebook应用审核
  • 非好友的消息请求会进入单独文件夹
  • 秘密对话支持端到端加密
  • 视频/语音通话无法完全自动化
  • 企业账户具有不同的功能
  • Messenger Rooms有独立的功能