telegram-web
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTelegram Web Skill
Telegram Web 技能
Overview
概述
Automates Telegram Web interactions including messaging, group management, channel operations, and file sharing through browser automation.
通过浏览器自动化实现Telegram Web交互的自动化,包括消息发送、群组管理、频道操作和文件分享。
Quick Install
快速安装
bash
curl -sSL https://canifi.com/skills/telegram-web/install.sh | bashOr manually:
bash
cp -r skills/telegram-web ~/.canifi/skills/bash
curl -sSL https://canifi.com/skills/telegram-web/install.sh | bash或手动安装:
bash
cp -r skills/telegram-web ~/.canifi/skills/Setup
设置
Configure via canifi-env:
bash
undefined通过canifi-env进行配置:
bash
undefinedFirst, ensure canifi-env is installed:
First, ensure canifi-env is installed:
curl -sSL https://canifi.com/install.sh | bash
curl -sSL https://canifi.com/install.sh | bash
canifi-env set TELEGRAM_PHONE "+1234567890"
undefinedcanifi-env set TELEGRAM_PHONE "+1234567890"
undefinedPrivacy & 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:
- Complete the Browser Automation Setup using CDP mode
- Login to the service manually in the Playwright-controlled Chrome window
- Claude will use your authenticated session without ever seeing your password
如果你不想与Claude Code共享凭证:
- 使用CDP模式完成浏览器自动化设置
- 在Playwright控制的Chrome窗口中手动登录该服务
- 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 text messages
- Create and manage groups
- Administer channels and broadcasts
- Share files, photos, and media
- Search messages and contacts
- Manage notification settings
- Handle stickers and GIFs
- Create and manage bots (via BotFather)
- 发送和接收文本消息
- 创建和管理群组
- 管理频道和广播
- 分享文件、照片和媒体内容
- 搜索消息和联系人
- 管理通知设置
- 处理贴纸和GIF
- 创建和管理机器人(通过BotFather)
Usage Examples
使用示例
Example 1: Send a Message
示例1:发送消息
User: "Send a Telegram message to Mom saying I'll be home for dinner"
Claude: I'll send that message on Telegram.
- Navigate to web.telegram.org
- Search for Mom in contacts
- Open chat and type message
- Send: "I'll be home for dinner"
- Confirm message deliveredUser: "Send a Telegram message to Mom saying I'll be home for dinner"
Claude: I'll send that message on Telegram.
- Navigate to web.telegram.org
- Search for Mom in contacts
- Open chat and type message
- Send: "I'll be home for dinner"
- Confirm message deliveredExample 2: Create a Group
示例2:创建群组
User: "Create a Telegram group called 'Project Team' with Alex and Sarah"
Claude: I'll create that group.
- Navigate to Telegram Web
- Click New Group
- Add Alex and Sarah
- Name group "Project Team"
- Confirm group createdUser: "Create a Telegram group called 'Project Team' with Alex and Sarah"
Claude: I'll create that group.
- Navigate to Telegram Web
- Click New Group
- Add Alex and Sarah
- Name group "Project Team"
- Confirm group createdExample 3: Post to Channel
示例3:发布频道内容
User: "Post an update to my Telegram channel about the new feature"
Claude: I'll post that update.
- Navigate to channel admin view
- Compose update message
- Add any relevant media
- Publish to channel
- Confirm post liveUser: "Post an update to my Telegram channel about the new feature"
Claude: I'll post that update.
- Navigate to channel admin view
- Compose update message
- Add any relevant media
- Publish to channel
- Confirm post liveExample 4: Search Messages
示例4:搜索消息
User: "Find all messages with flight confirmation in Telegram"
Claude: I'll search your Telegram messages.
- Open global search
- Search "flight confirmation"
- Collect matching messages
- Present results with chat contextUser: "Find all messages with flight confirmation in Telegram"
Claude: I'll search your Telegram messages.
- Open global search
- Search "flight confirmation"
- Collect matching messages
- Present results with chat contextAuthentication Flow
认证流程
- Navigate to web.telegram.org via Playwright MCP
- Enter phone number from canifi-env
- Wait for SMS/Telegram code (notify user via iMessage)
- Enter verification code when provided
- Handle 2FA password if enabled
- Verify access to chats
- Maintain session via local storage
- 通过Playwright MCP导航至web.telegram.org
- 从canifi-env中获取电话号码并输入
- 等待SMS/Telegram验证码(通过iMessage通知用户)
- 收到验证码后输入
- 若启用2FA则处理密码输入
- 验证是否可访问聊天
- 通过本地存储维持会话
Error Handling
错误处理
- Login Failed: Request new verification code, retry 3x
- Session Expired: Re-authenticate with phone number
- Rate Limited: Wait 30-60 seconds before retry
- Code Expired: Request new verification code
- 2FA Required: iMessage for password input
- Contact Not Found: Search by name variations and phone number
- Group Limit Reached: Notify user of Telegram limits
- File Too Large: Notify user of size restrictions
- 登录失败:请求新的验证码,重试3次
- 会话过期:使用电话号码重新认证
- 速率限制:等待30-60秒后重试
- 验证码过期:请求新的验证码
- 需要2FA:通过iMessage请求密码输入
- 未找到联系人:尝试按名称变体和电话号码搜索
- 达到群组限制:通知用户Telegram的限制
- 文件过大:通知用户尺寸限制
Self-Improvement Instructions
自我改进说明
When encountering new Telegram features:
- Document new UI patterns and selectors
- Add support for new message types
- Log successful channel management patterns
- Update capabilities for new features
当遇到Telegram新功能时:
- 记录新的UI模式和选择器
- 添加对新消息类型的支持
- 记录成功的频道管理模式
- 更新功能以支持新特性
Notes
注意事项
- Telegram Web requires phone verification each session
- Some features only available in Telegram Desktop
- File size limits apply (2GB for premium, 4GB for non-premium)
- Secret chats not available on web version
- Session may be terminated by mobile app logout
- Channels have different admin roles and permissions
- Telegram Web每次会话都需要电话验证
- 部分功能仅在Telegram Desktop中可用
- 存在文件大小限制(高级用户2GB,普通用户4GB)
- 网页版不支持秘密聊天
- 移动端应用登出可能会终止会话
- 频道拥有不同的管理员角色和权限