wildix-send-message
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSend Message
发送消息
Send a text message (with optional file attachments or as a reply) to an x-bees, collaboration 7, or x-hoppers channel — either as a bot or on behalf of a user.
代表机器人或用户向x-bees、collaboration 7或x-hoppers频道发送文本消息(可附带文件附件或作为回复)。
Peer Skills
关联技能
Before running, check if required peer skills are installed:
bash
Glob ~/.claude/skills/wildix-auth/SKILL.md运行前,请检查是否已安装所需的关联技能:
bash
Glob ~/.claude/skills/wildix-auth/SKILL.mdIf missing: npx skills add Wildix/agent-skills --s wildix-auth -y
若缺失:npx skills add Wildix/agent-skills --s wildix-auth -y
See [`peers.yaml`](peers.yaml) for full peer manifest.
完整的关联技能清单请查看[`peers.yaml`](peers.yaml)。Choosing a Token
选择令牌
BOT_TOKEN in .env?
YES → use bot mode (no auth needed)
NO → user wants to send as themselves?
YES → get ID_TOKEN via wildix-auth skill
NO → ask: "Provide BOT_TOKEN or send as your user account?"
BOT_TOKEN provided → save to .env, use bot mode
user account → get ID_TOKEN via wildix-auth skill.env文件中是否存在BOT_TOKEN?
是 → 使用机器人模式(无需认证)
否 → 用户是否要以自身身份发送?
是 → 通过wildix-auth技能获取ID_TOKEN
否 → 询问:“请提供BOT_TOKEN,还是使用您的用户账户发送?”
提供BOT_TOKEN → 保存到.env,使用机器人模式
使用用户账户 → 通过wildix-auth技能获取ID_TOKENMode 1: Simple text message
模式1:简单文本消息
Bot:
bash
bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<text>"User (pass ID_TOKEN via env):
bash
ID_TOKEN="$ID_TOKEN" bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<text>"机器人模式:
bash
bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<text>"用户模式(通过环境变量传递ID_TOKEN):
bash
ID_TOKEN="$ID_TOKEN" bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<text>"Mode 2: Reply to a message (quote)
模式2:回复消息(引用)
Pass — the server renders the quoted message in the UI automatically.
--reply-to <messageId>bash
undefined传递 —— 服务器会在UI中自动渲染被引用的消息。
--reply-to <messageId>bash
undefinedBot:
机器人模式:
bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<replyText>"
--reply-to "<messageId>"
--reply-to "<messageId>"
bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<replyText>"
--reply-to "<messageId>"
--reply-to "<messageId>"
User (token via env):
用户模式(通过环境变量传递令牌):
ID_TOKEN="$ID_TOKEN" bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<replyText>"
--reply-to "<messageId>"
--reply-to "<messageId>"
The `messageId` is the 32-char ID from a previous message (available in chat history).
The script automatically fetches the original message to build the full `quote` object (API requires `messageId`, `channelId`, `createdAt`, `user`).
---ID_TOKEN="$ID_TOKEN" bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<replyText>"
--reply-to "<messageId>"
--reply-to "<messageId>"
`messageId`是历史消息中的32位字符ID(可在聊天历史中找到)。
脚本会自动获取原始消息以构建完整的`quote`对象(API需要`messageId`、`channelId`、`createdAt`、`user`)。
---Mode 3: Send with file attachments
模式3:发送带文件附件的消息
Step 1 — upload each file
步骤1 —— 上传每个文件
bash
undefinedbash
undefinedBot:
机器人模式:
ATTACH1=$(bash <BASE_DIR>/scripts/upload-file.sh "<channelId>" "/path/to/file.pdf")
ATTACH2=$(bash <BASE_DIR>/scripts/upload-file.sh "<channelId>" "/path/to/image.png")
ATTACH1=$(bash <BASE_DIR>/scripts/upload-file.sh "<channelId>" "/path/to/file.pdf")
ATTACH2=$(bash <BASE_DIR>/scripts/upload-file.sh "<channelId>" "/path/to/image.png")
User (token via env):
用户模式(通过环境变量传递令牌):
ATTACH1=$(ID_TOKEN="$ID_TOKEN" bash <BASE_DIR>/scripts/upload-file.sh "<channelId>" "/path/to/file.pdf")
ATTACH2=$(ID_TOKEN="$ID_TOKEN" bash <BASE_DIR>/scripts/upload-file.sh "<channelId>" "/path/to/image.png")
`upload-file.sh` outputs a `MessageAttachment` JSON string. It internally:
1. Requests a presigned S3 URL from the API
2. Uploads the file binary to S3
3. Fetches file metadata and returns it as JSONATTACH1=$(ID_TOKEN="$ID_TOKEN" bash <BASE_DIR>/scripts/upload-file.sh "<channelId>" "/path/to/file.pdf")
ATTACH2=$(ID_TOKEN="$ID_TOKEN" bash <BASE_DIR>/scripts/upload-file.sh "<channelId>" "/path/to/image.png")
`upload-file.sh`会输出一个`MessageAttachment` JSON字符串。其内部流程:
1. 向API请求一个预签名的S3 URL
2. 将文件二进制数据上传到S3
3. 获取文件元数据并以JSON格式返回Step 2 — send message with attachments
步骤2 —— 发送带附件的消息
bash
undefinedbash
undefinedBot:
机器人模式:
bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<text>"
--attach "$ATTACH1"
--attach "$ATTACH2"
--attach "$ATTACH1"
--attach "$ATTACH2"
bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<text>"
--attach "$ATTACH1"
--attach "$ATTACH2"
--attach "$ATTACH1"
--attach "$ATTACH2"
User (token via env):
用户模式(通过环境变量传递令牌):
ID_TOKEN="$ID_TOKEN" bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<text>"
--attach "$ATTACH1"
--attach "$ATTACH1"
---ID_TOKEN="$ID_TOKEN" bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<text>"
--attach "$ATTACH1"
--attach "$ATTACH1"
---Mode 4: Reply with attachments
模式4:带附件的回复
Combine and :
--reply-to--attachbash
ATTACH=$(bash <BASE_DIR>/scripts/upload-file.sh "<channelId>" "/path/to/file.pdf")
bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<text>" \
--reply-to "<messageId>" \
--attach "$ATTACH"结合和参数:
--reply-to--attachbash
ATTACH=$(bash <BASE_DIR>/scripts/upload-file.sh "<channelId>" "/path/to/file.pdf")
bash <BASE_DIR>/scripts/send-message.sh "<channelId>" "<text>" \
--reply-to "<messageId>" \
--attach "$ATTACH"API
API
| Operation | Endpoint |
|---|---|
| Send message | |
| Request upload URL | |
| Upload binary | |
| Get file metadata | |
Send message body fields:
- — message text (required unless attachments present)
text - — messageId to reply to
quote.messageId - — array of
attachmentsobjects from upload stepMessageAttachment
| 操作 | 端点 |
|---|---|
| 发送消息 | |
| 请求上传URL | |
| 上传二进制数据 | |
| 获取文件元数据 | |
发送消息请求体字段:
- —— 消息文本(除非有附件,否则为必填项)
text - —— 要回复的消息ID
quote.messageId - —— 来自上传步骤的
attachments对象数组MessageAttachment
.env format
.env格式
<BASE_DIR>/.envBOT_TOKEN=wsk-v1-...<BASE_DIR>/.envBOT_TOKEN=wsk-v1-...Common Mistakes
常见错误
| Problem | Fix |
|---|---|
| Using AccessToken instead of IdToken | Always use IdToken (from wildix-auth) for user-mode sends |
Passing raw file path to | First run |
| On macOS |
| S3 upload 403 | Presigned URL expired — re-run |
| 问题 | 解决方法 |
|---|---|
| 使用AccessToken而非IdToken | 用户模式发送时请始终使用IdToken(来自wildix-auth) |
直接将原始文件路径传递给 | 先运行 |
| macOS系统中 |
| S3上传返回403 | 预签名URL已过期 —— 重新运行 |