discord

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Discord Skill

Discord 技能

Overview

概述

Automates Discord interactions including messaging, server management, moderation, and community engagement through the Discord web application.
通过Discord网页应用自动执行Discord交互操作,包括消息发送、服务器管理、社区管控和社区互动。

Quick Install

快速安装

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

Setup

配置

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

First, ensure canifi-env is installed:

首先,确保已安装canifi-env:

canifi-env set DISCORD_EMAIL "your-email@example.com" canifi-env set DISCORD_PASSWORD "your-password"
undefined
canifi-env set DISCORD_EMAIL "your-email@example.com" canifi-env set DISCORD_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 direct messages and server messages
  • Create and manage servers, channels, and categories
  • Moderate users (kick, ban, timeout, roles)
  • Search messages and users across servers
  • Manage server settings and permissions
  • React to messages and add emoji reactions
  • Create and manage events
  • Handle friend requests and relationships
  • 发送私信和服务器消息
  • 创建和管理服务器、频道及分类
  • 管理用户(踢出、封禁、限时禁言、角色设置)
  • 跨服务器搜索消息和用户
  • 管理服务器设置和权限
  • 对消息进行回应并添加表情反应
  • 创建和管理活动
  • 处理好友请求和关系

Usage Examples

使用示例

Example 1: Send a Direct Message

示例1:发送私信

User: "Send a Discord DM to GameMaster asking about tonight's session"
Claude: I'll send that DM on Discord.
- Navigate to Discord web app
- Open DM with GameMaster
- Type and send: "Hey, are we still on for tonight's session?"
- Confirm message delivered
用户:"给Discord上的GameMaster发私信,询问今晚的活动安排"
Claude:我会在Discord上发送这条私信。
- 导航至Discord网页应用
- 打开与GameMaster的私信对话框
- 输入并发送:"嘿,今晚的活动还照常进行吗?"
- 确认消息已送达

Example 2: Post in a Server Channel

示例2:在服务器频道中发布消息

User: "Announce in the #announcements channel that the event is starting"
Claude: I'll post the announcement.
- Navigate to specified server
- Open #announcements channel
- Compose and send announcement message
- Confirm post successful
用户:"在#announcements频道中发布活动即将开始的通知"
Claude:我会发布这条通知。
- 导航至指定服务器
- 打开#announcements频道
- 撰写并发送通知消息
- 确认发布成功

Example 3: Moderate a User

示例3:管理用户

User: "Give user ToxicPlayer a 1 hour timeout in the gaming server"
Claude: I'll apply the timeout.
- Navigate to the gaming server
- Find user ToxicPlayer
- Apply 1 hour timeout via moderation menu
- Confirm timeout applied
用户:"在游戏服务器中给用户ToxicPlayer设置1小时的限时禁言"
Claude:我会设置这个限时禁言。
- 导航至游戏服务器
- 找到用户ToxicPlayer
- 通过管理菜单设置1小时限时禁言
- 确认限时禁言已生效

Example 4: Create an Event

示例4:创建活动

User: "Create a Discord event for Friday at 8pm called 'Game Night'"
Claude: I'll create the event.
- Navigate to server events
- Create new event "Game Night"
- Set date/time for Friday 8pm
- Confirm event created and shareable
用户:"在Discord上创建一个名为'游戏之夜'的活动,时间为周五晚上8点"
Claude:我会创建这个活动。
- 导航至服务器活动页面
- 创建名为"游戏之夜"的新活动
- 设置日期/时间为周五晚上8点
- 确认活动已创建并可分享

Authentication Flow

认证流程

  1. Navigate to discord.com/app via Playwright MCP
  2. Enter email and password from canifi-env
  3. Handle CAPTCHA if presented (notify user)
  4. Complete 2FA via authenticator (notify user via iMessage)
  5. Verify login successful by checking for servers list
  6. Maintain session for subsequent operations
  1. 通过Playwright MCP导航至discord.com/app
  2. 从canifi-env中获取邮箱和密码并输入
  3. 如果出现CAPTCHA(人机验证),通知用户处理
  4. 通过验证器完成2FA(双因素认证),并通过iMessage通知用户
  5. 通过检查服务器列表验证登录是否成功
  6. 维持会话以便后续操作

Error Handling

错误处理

  • Login Failed: Clear cookies, retry 3x, then iMessage notification
  • Session Expired: Re-authenticate with stored credentials
  • Rate Limited: Wait for rate limit to clear (typically 5-60 seconds)
  • 2FA Required: iMessage notification for authenticator code
  • CAPTCHA Detected: Notify user to complete manually
  • Server Not Found: List available servers for user selection
  • Permission Denied: Notify user of missing permissions
  • User Not Found: Search server members and suggest matches
  • 登录失败:清除Cookie,重试3次,然后通过iMessage发送通知
  • 会话过期:使用存储的凭证重新认证
  • 请求受限:等待限制解除(通常为5-60秒)
  • 需要2FA:通过iMessage通知用户提供验证器代码
  • 检测到CAPTCHA:通知用户手动完成
  • 未找到服务器:列出可用服务器供用户选择
  • 权限不足:通知用户缺少相应权限
  • 未找到用户:搜索服务器成员并提供匹配建议

Self-Improvement Instructions

自我改进说明

When encountering new Discord features or UI changes:
  1. Document updated selectors and interaction patterns
  2. Add new capabilities to the list
  3. Log successful moderation workflows
  4. Suggest SKILL.md updates for new features
当遇到Discord的新功能或UI变化时:
  1. 记录更新后的选择器和交互模式
  2. 在功能列表中添加新功能
  3. 记录成功的管理工作流程
  4. 建议更新SKILL.md以适配新功能

Notes

注意事项

  • Discord uses dynamic content loading; wait for elements properly
  • Voice channels cannot be fully automated (audio limitations)
  • Some servers require phone verification
  • Nitro features may not be available on free accounts
  • Bot detection may trigger additional verification
  • Server boosts affect available features
  • Discord使用动态内容加载;需等待元素正确加载后再操作
  • 语音频道无法完全自动化(受音频限制)
  • 部分服务器需要手机号验证
  • 免费账户可能无法使用Nitro功能
  • 机器人检测可能触发额外验证
  • 服务器提升会影响可用功能