完善欢迎卡片和帮助信息

修改:
- 欢迎卡片添加帮助按钮
- 帮助信息使用卡片形式展示,更美观
- 帮助卡片包含:
  - 上传方式说明
  - 配置命令列表
  - 路径命令列表
  - 使用示例
  - 快捷操作按钮
This commit is contained in:
饭团
2026-03-06 12:06:31 +08:00
parent 596869260f
commit cc961e3b4e

View File

@@ -641,59 +641,48 @@ async function handleProfileCommandV2(message, content, feishu) {
} }
async function handleHelpCommandV2(chatId, feishu) { async function handleHelpCommandV2(chatId, feishu) {
await feishu.sendMessage(chatId, { const helpCard = {
msg_type: 'text',
content: { text: `
🍙 七牛云上传 - 使用帮助
📤 上传方式:
**方式 1选择配置 → 发送文件**
1. 发送 /upload
2. 选择上传配置
3. 发送文件
4. 确认上传
**方式 2发送文件 → 选择配置**
1. 直接发送文件
2. 选择上传配置
3. 确认上传
⚙️ 配置管理:
/config list - 查看七牛云配置
/profile list - 查看上传配置模板
/profile add <名称> <存储桶> [路径] - 添加上传配置
/profile remove <名称> - 删除上传配置
📁 路径管理:
/path list - 查看预设路径
/path add <名称> <路径> - 添加预设路径
💡 示例:
/profile add IPA 上传 default /ipa/
/profile add 备份 default /backup/
/profile list
/profile remove 备份
**提示:**
- 上传同名文件会自动覆盖
` }
});
}
async function sendWelcomeCard(chatId, feishu) {
const card = {
config: { wide_screen_mode: true }, config: { wide_screen_mode: true },
header: { header: {
template: 'blue', template: 'green',
title: { content: '🍙 七牛云上传机器人', tag: 'plain_text' } title: { content: '❓ 使用帮助', tag: 'plain_text' }
}, },
elements: [ elements: [
{ {
tag: 'div', tag: 'div',
text: { text: {
tag: 'lark_md', tag: 'lark_md',
content: '你好!我是七牛云上传机器人。\n\n**使用方式:**\n• /upload - 选择配置上传\n• 直接发送文件\n\n**命令:**\n• /config - 配置\n• /path - 路径\n• /help - 帮助' content: '**🍙 七牛云上传机器人**\n快速上传文件到七牛云存储'
}
},
{
tag: 'hr'
},
{
tag: 'div',
text: {
tag: 'lark_md',
content: '**📤 上传方式**\n\n**方式 1选择配置 → 发送文件**\n1⃣ 发送 /upload\n2⃣ 选择上传配置\n3⃣ 发送文件\n4⃣ 确认上传\n\n**方式 2发送文件 → 选择配置**\n1⃣ 直接发送文件\n2⃣ 选择上传配置\n3⃣ 确认上传'
}
},
{
tag: 'hr'
},
{
tag: 'div',
text: {
tag: 'lark_md',
content: '**⚙️ 配置命令**\n\n• /config list - 查看存储桶\n• /profile list - 查看上传配置\n• /profile add <名称> <桶> [路径] - 添加配置\n• /profile remove <名称> - 删除配置\n\n**📁 路径命令**\n\n• /path list - 查看预设路径\n• /path add <名称> <路径> - 添加路径'
}
},
{
tag: 'hr'
},
{
tag: 'div',
text: {
tag: 'lark_md',
content: '**💡 示例**\n\n`/profile add IPA 上传 default ipa`\n`/path add backup /backup/`\n\n**提示:** 上传同名文件会自动覆盖'
} }
}, },
{ {
@@ -715,6 +704,54 @@ async function sendWelcomeCard(chatId, feishu) {
} }
] ]
}; };
await feishu.sendCard(chatId, helpCard);
}
async function sendWelcomeCard(chatId, feishu) {
const card = {
config: { wide_screen_mode: true },
header: {
template: 'blue',
title: { content: '🍙 七牛云上传机器人', tag: 'plain_text' }
},
elements: [
{
tag: 'div',
text: {
tag: 'lark_md',
content: '你好!我是七牛云上传机器人,帮你快速上传文件到七牛云。\n\n**📤 上传方式:**\n• 发送 /upload 选择配置\n• 直接发送文件\n\n**⚙️ 常用命令:**\n• /config - 查看存储桶配置\n• /path - 管理预设路径\n• /profile - 管理上传配置'
}
},
{
tag: 'action',
actions: [
{
tag: 'button',
text: { tag: 'plain_text', content: '📤 上传文件' },
type: 'primary',
value: { action: 'start_upload' }
},
{
tag: 'button',
text: { tag: 'plain_text', content: '❓ 帮助' },
type: 'default',
value: { action: 'help' }
}
]
},
{
tag: 'hr'
},
{
tag: 'div',
text: {
tag: 'lark_md',
content: '💡 **提示:** 点击"帮助"查看详细使用指南'
}
}
]
};
await feishu.sendCard(chatId, card); await feishu.sendCard(chatId, card);
} }